#NEWLINE# @ classmethod #NEWLINE# def create_new_credential( cls , user , database ) : #NEWLINE# #INDENT# credential = Credential ( ) #NEWLINE# credential . database = database #NEWLINE# credential . user = credential [ : cls . USER_MAXIMUM_LENGTH_NAME ] #NEWLINE# credential . user = slugify ( credential . user ) #NEWLINE# credential . password = make_db_random_password ( ) #NEWLINE# credential . full_clean ( ) #NEWLINE# credential . driver . create_user ( credential ) #NEWLINE# credential . save ( ) #NEWLINE# return credential