#NEWLINE# def clean_username( self ) : #NEWLINE# #INDENT# username = username . cleaned_data [ 'username' ] #NEWLINE# try : #NEWLINE# #INDENT# get_user_model ( ) . _default_manager . get ( username = username ) #NEWLINE# #UNINDENT# except get_user_model ( ) . DoesNotExist : #NEWLINE# #INDENT# return username #NEWLINE# #UNINDENT# raise forms . ValidationError ( self . error_messages [ 'duplicate_username' ] , code = 'duplicate_username' )