From: "Slava Bacherikov" <slava@bacherikov.org.ua>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoo-packages:master commit in: gpackages/apps/packages/templatetags/
Date: Fri, 6 Jul 2012 23:09:33 +0000 (UTC) [thread overview]
Message-ID: <1341585113.846b6fd9c5bccf194c44dd9d28f4946316dc927e.bacher09@gentoo> (raw)
commit: 846b6fd9c5bccf194c44dd9d28f4946316dc927e
Author: Slava Bacherikov <slava <AT> bacher09 <DOT> org>
AuthorDate: Fri Jul 6 14:31:53 2012 +0000
Commit: Slava Bacherikov <slava <AT> bacherikov <DOT> org <DOT> ua>
CommitDate: Fri Jul 6 14:31:53 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-packages.git;a=commit;h=846b6fd9
Fix bug in last_updated template tag
---
gpackages/apps/packages/templatetags/packages.py | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/gpackages/apps/packages/templatetags/packages.py b/gpackages/apps/packages/templatetags/packages.py
index e381cb0..1a6d24a 100644
--- a/gpackages/apps/packages/templatetags/packages.py
+++ b/gpackages/apps/packages/templatetags/packages.py
@@ -7,8 +7,13 @@ from ..models import RepositoryModel
@register.inclusion_tag('last_updated.html')
def last_updated():
- l = RepositoryModel.objects.only('updated_datetime').latest('updated_datetime')
- return {'last_updated': l.updated_datetime}
+ try:
+ l = RepositoryModel.objects.only('updated_datetime'). \
+ latest('updated_datetime')
+ except RepositoryModel.DoesNotExist:
+ return {'las_updated' : None}
+ else:
+ return {'last_updated': l.updated_datetime}
@register.inclusion_tag('keywords_table.html')
def render_keywords_table(obj, arch_list):
next reply other threads:[~2012-07-06 23:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-06 23:09 Slava Bacherikov [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-07-15 23:08 [gentoo-commits] proj/gentoo-packages:master commit in: gpackages/apps/packages/templatetags/ Slava Bacherikov
2012-07-31 23:20 Slava Bacherikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1341585113.846b6fd9c5bccf194c44dd9d28f4946316dc927e.bacher09@gentoo \
--to=slava@bacherikov.org.ua \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox