Mercurial > public > sg101
view gpp/accounts/admin.py @ 533:387d46abcb95
Updated to Haystack 1.2.6. Got the latest Haystack, xapian backend, and
queued_search from PyPi. This is for ticket #215.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Mon, 26 Dec 2011 23:05:29 +0000 |
parents | d1b11096595b |
children |
line wrap: on
line source
"""This file contains the automatic admin site definitions for the accounts Models""" from django.contrib import admin from accounts.models import IllegalUsername from accounts.models import IllegalEmail from accounts.models import PendingUser from accounts import create_new_user class PendingUserAdmin(admin.ModelAdmin): list_display = ('username', 'email', 'date_joined') actions = ('activate_account', ) def activate_account(self, request, qs): """ Activate the accounts of the selected pending users. """ for pending_user in qs: create_new_user(pending_user, admin_activation=True) self.message_user(request, "%s accounts activated" % qs.count()) activate_account.short_description = "Activate accounts for selected users" admin.site.register(IllegalUsername) admin.site.register(IllegalEmail) admin.site.register(PendingUser, PendingUserAdmin)