Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def getSetups():
availableSetups = [ "{ text : '%s', url : '%s' }" % ( setupName,
diracURL( controller = 'web/userdata',
action = 'changeSetup',
id = setupName ) ) for setupName in gWebConfig.getSetups() ]
return "[%s]" % ",".join( availableSetups )
def __checkSetup( setup ):
if setup not in gWebConfig.getSetups():
return gWebConfig.getDefaultSetup()
return setup
def changeSetup( self ):
return self.__changeURLPropertyAndRedirect( 'dsetup', gWebConfig.getSetups() )
def getSelectedSetup():
setup = request.environ[ 'pylons.routes_dict' ][ 'dsetup' ]
if setup not in gWebConfig.getSetups():
return gWebConfig.getDefaultSetup()
return setup