# HG changeset patch # User Brian Neal # Date 1301099160 0 # Node ID 701730b2fcda52c1f0900f8695174ffafb3ba85d # Parent accfc1fdb88dc1fb3fbdc1bd71983f6d16774ecf Fixing #196; add status messages in the admin after approving news and links. diff -r accfc1fdb88d -r 701730b2fcda gpp/bio/admin.py --- 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])) diff -r accfc1fdb88d -r 701730b2fcda gpp/news/admin.py --- 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: diff -r accfc1fdb88d -r 701730b2fcda gpp/weblinks/admin.py --- 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"