#NEWLINE# def clean_language( self ) : #NEWLINE# #INDENT# "Make sure language doesn't get a invalid value." #NEWLINE# data = self . cleaned_data [ 'language' ] #NEWLINE# if isinstance ( data , Language ) : #NEWLINE# #INDENT# pk = data . pk #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# pk = int ( data ) #NEWLINE# #UNINDENT# if ( pk in self . disabled_langs ) : #NEWLINE# #INDENT# raise forms . ValidationError ( _ ( 'Enter a valid value.' ) ) #NEWLINE# #UNINDENT# return data