#NEWLINE# def _check_permission_clashing( custom , builtin , ctype ) : #NEWLINE# #INDENT# '\n    Check that permissions for a model do not clash. Raises CommandError if\n    there are duplicate permissions.\n    ' #NEWLINE# pool = set ( ) #NEWLINE# builtin_codenames = set ( ( p [ 0 ] for p in builtin ) ) #NEWLINE# for ( codename , _name ) in custom : #NEWLINE# #INDENT# if ( codename in pool ) : #NEWLINE# #INDENT# raise CommandError ( ( "The permission codename '%s' is duplicated for model '%s.%s'." % ( codename , ctype . app_label , ctype . model_class ( ) . __name__ ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( codename in builtin_codenames ) : #NEWLINE# #INDENT# raise CommandError ( ( "The permission codename '%s' clashes with a builtin permission for model '%s.%s'." % ( codename , ctype . app_label , ctype . model_class ( ) . __name__ ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# pool . add ( codename )