Mercurial > public > sg101
changeset 398:701730b2fcda
Fixing #196; add status messages in the admin after approving news and links.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 26 Mar 2011 00:26:00 +0000 |
parents | accfc1fdb88d |
children | 24f1230f3ee3 |
files | gpp/bio/admin.py gpp/news/admin.py gpp/weblinks/admin.py |
diffstat | 3 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/gpp/bio/admin.py Fri Mar 25 23:59:16 2011 +0000 +++ b/gpp/bio/admin.py Sat Mar 26 00:26:00 2011 +0000 @@ -56,7 +56,7 @@ profile.status_date = now profile.save() - count = qs.count() + count = len(qs) msg = "1 user" if count == 1 else "%d users" % count self.message_user(request, "%s successfully marked as %s." % (msg, bio.models.USER_STATUS_CHOICES[status][1]))
--- a/gpp/news/admin.py Fri Mar 25 23:59:16 2011 +0000 +++ b/gpp/news/admin.py Sat Mar 26 00:26:00 2011 +0000 @@ -40,6 +40,10 @@ story.save() pending_story.delete() + count = len(qs) + msg = "1 story" if count == 1 else "%d stories" % count + self.message_user(request, "%s approved." % msg) + approve_story.short_description = "Approve selected pending stories" class Media:
--- a/gpp/weblinks/admin.py Fri Mar 25 23:59:16 2011 +0000 +++ b/gpp/weblinks/admin.py Sat Mar 26 00:26:00 2011 +0000 @@ -33,6 +33,10 @@ link.save() pending_link.delete() + count = len(qs) + msg = "1 link" if count == 1 else "%d links" % count + self.message_user(request, "%s approved." % msg) + approve_links.short_description = "Approve selected links"