<s> from django . contrib import admin <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from django . contrib . sites . requests import RequestSite <EOL> from django . apps import apps <EOL> from . models import RegistrationProfile <EOL> from . users import UsernameField <EOL> class RegistrationAdmin ( admin . ModelAdmin ) : <EOL> actions = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> list_display = ( '<STR_LIT:user>' , '<STR_LIT>' ) <EOL> raw_id_fields = [ '<STR_LIT:user>' ] <EOL> search_fields = ( '<STR_LIT>' . format ( UsernameField ( ) ) , <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> def activate_users ( self , request , queryset ) : <EOL> """<STR_LIT>""" <EOL> for profile in queryset : <EOL> RegistrationProfile . objects . activate_user ( profile . activation_key ) <EOL> activate_users . short_description = _ ( "<STR_LIT>" ) <EOL> def resend_activation_email ( self , request , queryset ) : <EOL> """<STR_LIT>""" <EOL> if apps . is_installed ( '<STR_LIT>' ) : <EOL> site = apps . get_model ( '<STR_LIT>' , '<STR_LIT>' ) . objects . get_current ( ) <EOL> else : <EOL> site = RequestSite ( request ) <EOL> for profile in queryset : <EOL> user = profile . user <EOL> RegistrationProfile . objects . resend_activation_mail ( user . email , site , request ) <EOL> resend_activation_email . short_description = _ ( "<STR_LIT>" ) <EOL> admin . site . register ( RegistrationProfile , RegistrationAdmin ) </s>
