#NEWLINE# def check_create_permission( self , request , mode ) : #NEWLINE# #INDENT# request . context = _get_default_context ( request ) #NEWLINE# request . agent = request . context [ 'agent' ] #NEWLINE# request . profile = request . user . profile #NEWLINE# request . queue = None #NEWLINE# if ( 'queue_id' in self . GET ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# request . queue = TicketQueue . objects . get ( pk = request . GET [ 'queue_id' ] ) #NEWLINE# #UNINDENT# except self . model . DoesNotExist : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( not request . user . profile . has_permission ( request . queue , mode = 'x' ) ) : #NEWLINE# #INDENT# request . queue = None #NEWLINE# #UNINDENT# #UNINDENT# return True