def update_vouch_flags_action():
 def update_vouch_flags(modeladmin, request, queryset):
  for profile in queryset:
   vouches_received = profile.vouches_received.count()
   profile.can_vouch = (vouches_received >= settings.CAN_VOUCH_THRESHOLD)
   profile.is_vouched = (vouches_received > 0)
   profile.save()
 update_vouch_flags.short_description = 'Update vouch flags'
 return update_vouch_flags

def update_vouch_flags_action ( ) : def update_vouch_flags ( modeladmin , request , queryset ) : for profile in queryset : vouches_received = profile . vouches_received . count ( ) profile . can_vouch = ( vouches_received >= settings . CAN_VOUCH_THRESHOLD ) profile . is_vouched = ( vouches_received > 0 ) profile . save ( ) update_vouch_flags . short_description = 'Update vouch flags' return update_vouch_flags
update can_vouch .