Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

moved DEFAULT_HTTP_PROTOCOL to a global variable and fixed another mi…

…ssed instance of http hardcoding
  • Loading branch information...
commit bd95ae7ee579679f01d6c9166d74adf85c8b8cce 1 parent 850cb34
@brosner brosner authored
Showing with 10 additions and 8 deletions.
  1. +10 −8 notification/feeds.py
View
18 notification/feeds.py
@@ -11,13 +11,15 @@
from notification.models import Notice
from notification.atomformat import Feed
+
ITEMS_PER_FEED = getattr(settings, 'ITEMS_PER_FEED', 20)
+DEFAULT_HTTP_PROTOCOL = getattr(settings, "DEFAULT_HTTP_PROTOCOL", "http")
+
class BaseNoticeFeed(Feed):
def item_id(self, notification):
- protocol = getattr(settings, "DEFAULT_HTTP_PROTOCOL", "http")
return "%s://%s%s" % (
- protocol,
+ DEFAULT_HTTP_PROTOCOL,
Site.objects.get_current().domain,
notification.get_absolute_url(),
)
@@ -45,9 +47,8 @@ def get_object(self, params):
return get_object_or_404(User, username=params[0].lower())
def feed_id(self, user):
- protocol = getattr(settings, "DEFAULT_HTTP_PROTOCOL", "http")
return "%s://%s%s" % (
- protocol,
+ DEFAULT_HTTP_PROTOCOL,
Site.objects.get_current().domain,
reverse('notification_feed_for_user'),
)
@@ -65,10 +66,11 @@ def feed_updated(self, user):
return qs.latest('added').added
def feed_links(self, user):
- complete_url = "http://%s%s" % (
- Site.objects.get_current().domain,
- reverse('notification_notices'),
- )
+ complete_url = "%s://%s%s" % (
+ DEFAULT_HTTP_PROTOCOL,
+ Site.objects.get_current().domain,
+ reverse('notification_notices'),
+ )
return ({'href': complete_url},)
def items(self, user):
Please sign in to comment.
Something went wrong with that request. Please try again.