From 2a4d766cf5785c38f923a18fb97107fa5df268bf Mon Sep 17 00:00:00 2001 From: gfawcett Date: Thu, 19 Mar 2009 02:01:00 +0000 Subject: [PATCH] a couple view tweaks. Feeds won't fail when empty. git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@198 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- conifer/syrup/views.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/conifer/syrup/views.py b/conifer/syrup/views.py index 4006d70..51fe881 100644 --- a/conifer/syrup/views.py +++ b/conifer/syrup/views.py @@ -203,6 +203,11 @@ def instructors(request): page_num=page_num, count=count) + +def departments(request): + raise NotImplementedError + + def user_prefs(request): return g.render('simplemessage.xhtml', title=_('Sorry...'), @@ -1006,8 +1011,7 @@ def course_feeds(request, course_id, feed_type): return '%s :: %s' % (item.parent_heading.title, item.title) else: return item.title - - lastmod = max(i.last_modified for i in items) + lastmod = items and max(i.last_modified for i in items) or datetime.now() return g.render('feeds/course_atom.xml', course=course, feed_type=feed_type, @@ -1016,3 +1020,4 @@ def course_feeds(request, course_id, feed_type): items=items, root='http://%s' % request.get_host(), _serialization='xml') + -- 2.11.0