<s> from django . contrib import admin <EOL> from django . contrib . auth . models import User <EOL> from django . contrib . auth . admin import UserAdmin <EOL> from django . contrib . auth . forms import UserChangeForm <EOL> from django import forms <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from django_digest . models import UserNonce , PartialDigest <EOL> class HackedUserChangeForm ( UserChangeForm ) : <EOL> """<STR_LIT>""" <EOL> username = forms . RegexField ( label = _ ( "<STR_LIT>" ) , max_length = <NUM_LIT> , regex = r'<STR_LIT>' , <EOL> help_text = _ ( "<STR_LIT>" ) , <EOL> error_messages = { '<STR_LIT>' : _ ( "<STR_LIT>" ) } ) <EOL> def _get_validation_exclusions ( self ) : <EOL> exclusions = super ( HackedUserChangeForm , self ) . _get_validation_exclusions ( ) <EOL> exclusions . append ( "<STR_LIT:username>" ) <EOL> return exclusions <EOL> class HackedUserAdmin ( UserAdmin ) : <EOL> """<STR_LIT>""" <EOL> form = HackedUserChangeForm <EOL> admin . site . unregister ( User ) <EOL> admin . site . register ( User , HackedUserAdmin ) <EOL> class DDUserNonceAdmin ( admin . ModelAdmin ) : <EOL> list_display = ( '<STR_LIT:user>' , '<STR_LIT>' , '<STR_LIT:count>' , '<STR_LIT>' ) <EOL> class DDPartialDigestAdmin ( admin . ModelAdmin ) : <EOL> list_display = ( '<STR_LIT:user>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> search_fields = ( '<STR_LIT>' , ) <EOL> admin . site . register ( UserNonce , DDUserNonceAdmin ) <EOL> admin . site . register ( PartialDigest , DDPartialDigestAdmin ) </s>
