11
11
from notification .models import Notice
12
12
from notification .atomformat import Feed
13
13
14
+
14
15
ITEMS_PER_FEED = getattr (settings , 'ITEMS_PER_FEED' , 20 )
16
+ DEFAULT_HTTP_PROTOCOL = getattr (settings , "DEFAULT_HTTP_PROTOCOL" , "http" )
17
+
15
18
16
19
class BaseNoticeFeed (Feed ):
17
20
def item_id (self , notification ):
18
- protocol = getattr (settings , "DEFAULT_HTTP_PROTOCOL" , "http" )
19
21
return "%s://%s%s" % (
20
- protocol ,
22
+ DEFAULT_HTTP_PROTOCOL ,
21
23
Site .objects .get_current ().domain ,
22
24
notification .get_absolute_url (),
23
25
)
@@ -45,9 +47,8 @@ def get_object(self, params):
45
47
return get_object_or_404 (User , username = params [0 ].lower ())
46
48
47
49
def feed_id (self , user ):
48
- protocol = getattr (settings , "DEFAULT_HTTP_PROTOCOL" , "http" )
49
50
return "%s://%s%s" % (
50
- protocol ,
51
+ DEFAULT_HTTP_PROTOCOL ,
51
52
Site .objects .get_current ().domain ,
52
53
reverse ('notification_feed_for_user' ),
53
54
)
@@ -65,10 +66,11 @@ def feed_updated(self, user):
65
66
return qs .latest ('added' ).added
66
67
67
68
def feed_links (self , user ):
68
- complete_url = "http://%s%s" % (
69
- Site .objects .get_current ().domain ,
70
- reverse ('notification_notices' ),
71
- )
69
+ complete_url = "%s://%s%s" % (
70
+ DEFAULT_HTTP_PROTOCOL ,
71
+ Site .objects .get_current ().domain ,
72
+ reverse ('notification_notices' ),
73
+ )
72
74
return ({'href' : complete_url },)
73
75
74
76
def items (self , user ):
0 commit comments