Browse Source

add admin action to set the users avatar to their gravatar

Natenom/support-murmur-13-1446181288462
Michael Ziegler 14 years ago
parent
commit
8e140168d5
  1. 7
      pyweb/mumble/admin.py

7
pyweb/mumble/admin.py

@ -163,6 +163,7 @@ class MumbleUserAdmin(admin.ModelAdmin):
list_display = [ 'name', 'server', 'owner', 'mumbleid', 'get_acl_admin' ] list_display = [ 'name', 'server', 'owner', 'mumbleid', 'get_acl_admin' ]
list_filter = [ 'server' ] list_filter = [ 'server' ]
search_fields = [ 'owner__username', 'name' ] search_fields = [ 'owner__username', 'name' ]
actions = [ 'set_texture_from_gravatar' ]
ordering = [ 'owner__username' ] ordering = [ 'owner__username' ]
form = MumbleUserAdminForm form = MumbleUserAdminForm
@ -175,6 +176,12 @@ class MumbleUserAdmin(admin.ModelAdmin):
get_acl_admin.short_description = _('Admin on root channel') get_acl_admin.short_description = _('Admin on root channel')
get_acl_admin.boolean = True get_acl_admin.boolean = True
def set_texture_from_gravatar( self, request, queryset ):
for mu in queryset:
mm.setTextureFromGravatar()
set_texture_from_gravatar.short_description = _( "Set Gravatar as Texture" )
admin.site.register( MumbleServer, MumbleServerAdmin ) admin.site.register( MumbleServer, MumbleServerAdmin )
admin.site.register( Mumble, MumbleAdmin ) admin.site.register( Mumble, MumbleAdmin )

Loading…
Cancel
Save