gremmie@1: """This file contains the automatic admin site definitions for the accounts Models""" gremmie@1: gremmie@1: from django.contrib import admin gremmie@1: from accounts.models import IllegalUsername gremmie@1: from accounts.models import IllegalEmail gremmie@1: from accounts.models import PendingUser bgneal@347: from accounts import create_new_user bgneal@347: gremmie@1: gremmie@1: class PendingUserAdmin(admin.ModelAdmin): gremmie@1: list_display = ('username', 'email', 'date_joined') bgneal@347: actions = ('activate_account', ) bgneal@347: bgneal@347: def activate_account(self, request, qs): bgneal@347: """ bgneal@347: Activate the accounts of the selected pending users. bgneal@347: bgneal@347: """ bgneal@347: for pending_user in qs: bgneal@347: create_new_user(pending_user, admin_activation=True) bgneal@347: bgneal@347: activate_account.short_description = "Activate accounts for selected users" bgneal@347: gremmie@1: gremmie@1: admin.site.register(IllegalUsername) gremmie@1: admin.site.register(IllegalEmail) gremmie@1: admin.site.register(PendingUser, PendingUserAdmin)