#NEWLINE# def generate_permissions( apps , schema_editor ) : #NEWLINE# #INDENT# Permission = apps . get_model ( 'auth' , 'Permission' ) #NEWLINE# try : #NEWLINE# #INDENT# Permission . objects . get ( codename = 'add_post' , content_type__app_label = 'blog' ) #NEWLINE# #UNINDENT# except Permission . DoesNotExist : #NEWLINE# #INDENT# models_module = getattr ( apps , 'models_module' , None ) #NEWLINE# if ( models_module is None ) : #NEWLINE# #INDENT# apps . models_module = True #NEWLINE# create_permissions ( apps , verbosity = 0 ) #NEWLINE# apps . models_module = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise