# HG changeset patch # User Brian Neal # Date 1272855588 0 # Node ID 8bbefaa3e408d9fe21dc4b07cba60ffadd8f968f # Parent 272d3a8c98e8647198c0de8109bc92a9ece73d34 Fix #79; user should get security pin when reporting profiles. diff -r 272d3a8c98e8 -r 8bbefaa3e408 gpp/bio/admin.py --- a/gpp/bio/admin.py Mon May 03 02:49:31 2010 +0000 +++ b/gpp/bio/admin.py Mon May 03 02:59:48 2010 +0000 @@ -6,6 +6,7 @@ from django.contrib import admin import bio.models +import bio.badges from comments.models import Comment from forums.tools import delete_user_posts @@ -96,6 +97,20 @@ class UserProfileFlagAdmin(admin.ModelAdmin): list_display = ('__unicode__', 'flag_date', 'get_profile_url') + actions = ('accept_flags', ) + + def accept_flags(self, request, qs): + """This action awards a security pin to the user that reported the + profile and then deletes the flag. + """ + for flag in qs: + bio.badges.award_badge(bio.badges.SECURITY_PIN, flag.user) + flag.delete() + + accept_flags.short_description = "Accept selected flagged profiles" + + + class BadgeAdmin(admin.ModelAdmin):