aboutsummaryrefslogtreecommitdiff
path: root/feeds.py
diff options
context:
space:
mode:
authorAlban Gruin2017-09-09 15:19:42 +0200
committerAlban Gruin2017-09-09 15:19:42 +0200
commit98242cad296b36423daf77e572d7735478d33f1d (patch)
tree71f753a3172008859048832f4a941c258168bc96 /feeds.py
parentc7fce37ad4c8dee76f5d58eafefd0c73a03ea00c (diff)
Ajout d’un flux RSS
Diffstat (limited to 'feeds.py')
-rw-r--r--feeds.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/feeds.py b/feeds.py
index 722f20c..2dd2479 100644
--- a/feeds.py
+++ b/feeds.py
@@ -14,6 +14,7 @@
# along with celcatsanitizer. If not, see <http://www.gnu.org/licenses/>.
from django.core.exceptions import ObjectDoesNotExist
+from django.conf import settings
from django.contrib.syndication.views import Feed
from django.db.models import Q
from django.template import loader
@@ -76,10 +77,7 @@ class IcalFeed(Feed):
"location": format_rooms(item.rooms.all())}
-class AtomFeed(Feed):
- author_name = "CelcatSanitizer"
- feed_type = Atom1Feed
-
+class RSSFeed(Feed):
def get_object(self, request, year_slug, timetable_slug, group_slug):
year, week = get_current_or_next_week()
try:
@@ -121,3 +119,9 @@ class AtomFeed(Feed):
update.description = template.render(context)
return obj[1]
+
+
+class AtomFeed(RSSFeed):
+ author_name = settings.ADMINS[0][0]
+ author_email = settings.ADMINS[0][1]
+ feed_type = Atom1Feed