示例#1
0
    def list_submissions():
        """ List submission IDs associated with the current user """
        filter_by = request.args.get('filter_by')
        filter_by = filter_by.lower() if filter_by is not None else filter_by
        accountManager = AccountHandler(request,bcrypt = bcrypt)

        if filter_by == 'agency':
            return RouteUtils.run_instance_function(accountManager, accountManager.listSubmissionsByCurrentUserAgency)
        return RouteUtils.run_instance_function(accountManager, accountManager.listSubmissionsByCurrentUser)
 def reset_password():
     """ Removes current password from DB and sends email with token for user to reset their password.  Expects 'email' key in request body. """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.resetPassword,
                                             RouteUtils.SYSTEM_EMAIL,
                                             session)
 def register_user():
     """ Expects request to have keys 'email', 'name', 'cgac_code', and 'title' """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.register,
                                             getSystemEmail=True,
                                             getSession=True)
 def checkEmailToken():
     """ Expects request to have token  """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(
         accountManager,
         accountManager.checkEmailConfirmationToken,
         getSession=True)
 def complete_generation(generationId):
     fileManager = FileHandler(request,
                               isLocal=IS_LOCAL,
                               serverPath=SERVER_PATH)
     return RouteUtils.run_instance_function(fileManager,
                                             fileManager.completeGeneration,
                                             generationId)
 def get_protected_files():
     """ Return signed URLs for all help page files """
     fileManager = FileHandler(request,
                               isLocal=IS_LOCAL,
                               serverPath=SERVER_PATH)
     return RouteUtils.run_instance_function(fileManager,
                                             fileManager.getProtectedFiles)
 def generate_file():
     """ Generate file from external API """
     fileManager = FileHandler(request,
                               isLocal=IS_LOCAL,
                               serverPath=SERVER_PATH)
     return RouteUtils.run_instance_function(fileManager,
                                             fileManager.generateFile)
 def check_generation_status():
     """ Return status of file generation job """
     fileManager = FileHandler(request,
                               isLocal=IS_LOCAL,
                               serverPath=SERVER_PATH)
     return RouteUtils.run_instance_function(fileManager,
                                             fileManager.checkGeneration)
 def submit_files():
     fileManager = FileHandler(request,
                               isLocal=IS_LOCAL,
                               serverPath=SERVER_PATH)
     return RouteUtils.run_instance_function(fileManager,
                                             fileManager.submit,
                                             LoginSession.getName(session),
                                             RouteUtils.CREATE_CREDENTIALS)
 def email_users():
     """
     Sends email notifications to users that their submission is ready for review & publish viewing
     """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.emailUsers,
                                             RouteUtils.SYSTEM_EMAIL,
                                             session)
 def list_users():
     """ list all users """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.listUsers)
 def change_status():
     """ Expects request to have keys 'user_email' and 'new_status' """
     accountManager = AccountHandler(request,bcrypt = bcrypt)
     return RouteUtils.run_instance_function(accountManager, accountManager.changeStatus,getSystemEmail = True)
示例#13
0
 def list_submissions():
     """ List submission IDs associated with the current user """
     accountManager = AccountHandler(request,bcrypt = bcrypt)
     return RouteUtils.run_instance_function(accountManager, accountManager.listSubmissionsByCurrentUser)
 def finalize_submission():
     fileManager = FileHandler(request,isLocal=IS_LOCAL, serverPath=SERVER_PATH)
     return RouteUtils.run_instance_function(fileManager, fileManager.finalize)
 def upload_local_file():
     fileManager = FileHandler(request,isLocal=IS_LOCAL, serverPath=SERVER_PATH)
     return RouteUtils.run_instance_function(fileManager, fileManager.uploadFile)
 def current_user():
     """ gets the current user information """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.getCurrentUser,
                                             getSession=True)
 def logout():
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.logout,
                                             getSession=True)
 def max_login():
     accountManager = AccountHandler(request)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.max_login,
                                             session)
 def logout():
     accountManager = AccountHandler(request,bcrypt = bcrypt)
     return RouteUtils.run_instance_function(accountManager, accountManager.logout, getSession = True)
 def list_agencies():
     """ List all CGAC Agencies """
     domainHandler = DomainHandler()
     return RouteUtils.run_instance_function(domainHandler, domainHandler.listAgencies)
 def login():
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.login, session)
 def current_user():
     """ gets the current user information """
     accountManager = AccountHandler(request,bcrypt = bcrypt)
     return RouteUtils.run_instance_function(accountManager, accountManager.getCurrentUser, getSession = True)
 def reset_password():
     """ Removes current password from DB and sends email with token for user to reset their password.  Expects 'email' key in request body. """
     accountManager = AccountHandler(request,bcrypt = bcrypt)
     return RouteUtils.run_instance_function(accountManager, accountManager.resetPassword, True,True)
 def set_password():
     """ Set a new password for specified user """
     accountManager = AccountHandler(request,bcrypt = bcrypt)
     return RouteUtils.run_instance_function(accountManager, accountManager.setNewPassword)
 def list_users_with_status():
     """ Expects request to have key 'status', will list all users with that status """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(
         accountManager, accountManager.listUsersWithStatus)
 def set_skip_guide():
     """ Sets skip_guide param for current user """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.setSkipGuide,
                                             getSession=True)
 def set_password():
     """ Set a new password for specified user """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.setNewPassword,
                                             getSession=True)
 def checkPasswordToken():
     """ Expects request to have email  """
     accountManager = AccountHandler(request,bcrypt = bcrypt)
     return RouteUtils.run_instance_function(accountManager, accountManager.checkPasswordToken, getSession = True)
 def set_skip_guide():
     """ Sets skip_guide param for current user """
     accountManager = AccountHandler(request,bcrypt = bcrypt)
     return RouteUtils.run_instance_function(accountManager, accountManager.setSkipGuide, getSession = True)
 def checkEmailToken():
     """ Expects request to have token  """
     accountManager = AccountHandler(request,bcrypt = bcrypt)
     return RouteUtils.run_instance_function(accountManager, accountManager.checkEmailConfirmationToken, getSession = True)
示例#31
0
 def submit_files():
     fileManager = FileHandler(request,isLocal=IS_LOCAL, serverPath=SERVER_PATH)
     return RouteUtils.run_instance_function(fileManager, fileManager.submit, getUser=True,getCredentials=True)
 def register_user():
     """ Expects request to have keys 'email', 'name', 'agency', and 'title' """
     accountManager = AccountHandler(request,bcrypt = bcrypt)
     return RouteUtils.run_instance_function(accountManager,accountManager.register, getSystemEmail = True, getSession = True)
 def submission_error_metrics():
     fileManager = FileHandler(request,isLocal=IS_LOCAL ,serverPath=SERVER_PATH)
     return RouteUtils.run_instance_function(fileManager, fileManager.getErrorMetrics)
 def confirm():
     """ Expects request to have email  """
     accountManager = AccountHandler(request,bcrypt = bcrypt)
     return RouteUtils.run_instance_function(accountManager, accountManager.createEmailConfirmation, True,True)
 def get_rss():
     fileManager = FileHandler(request,isLocal=IS_LOCAL, serverPath=SERVER_PATH)
     return RouteUtils.run_instance_function(fileManager, fileManager.getRss)
 def list_users():
     """ list all users """
     accountManager = AccountHandler(request,bcrypt = bcrypt)
     return RouteUtils.run_instance_function(accountManager, accountManager.listUsers)
 def check_status():
     fileManager = FileHandler(request,
                               isLocal=IS_LOCAL,
                               serverPath=SERVER_PATH)
     return RouteUtils.run_instance_function(fileManager,
                                             fileManager.getStatus)
 def list_users_with_status():
     """ Expects request to have key 'status', will list all users with that status """
     accountManager = AccountHandler(request,bcrypt = bcrypt)
     return RouteUtils.run_instance_function(accountManager, accountManager.listUsersWithStatus)
 def get_obligations():
     fileManager = FileHandler(request,
                               isLocal=IS_LOCAL,
                               serverPath=SERVER_PATH)
     return RouteUtils.run_instance_function(fileManager,
                                             fileManager.getObligations)
 def submission_error_metrics():
     fileManager = FileHandler(request,
                               isLocal=IS_LOCAL,
                               serverPath=SERVER_PATH)
     return RouteUtils.run_instance_function(fileManager,
                                             fileManager.getErrorMetrics)
 def finalize_submission():
     fileManager = FileHandler(request,
                               isLocal=IS_LOCAL,
                               serverPath=SERVER_PATH)
     return RouteUtils.run_instance_function(fileManager,
                                             fileManager.finalize)
 def update_user():
     """ Updates editable fields for the specified user """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager,
                                             accountManager.updateUser,
                                             getSystemEmail=True)
 def submission_warning_reports():
     fileManager = FileHandler(request,
                               isLocal=IS_LOCAL,
                               serverPath=SERVER_PATH)
     return RouteUtils.run_instance_function(
         fileManager, fileManager.getErrorReportURLsForSubmission, True)
 def confirm():
     """ Expects request to have email  """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(
         accountManager, accountManager.createEmailConfirmation, True, True)
 def upload_local_file():
     fileManager = FileHandler(request,
                               isLocal=IS_LOCAL,
                               serverPath=SERVER_PATH)
     return RouteUtils.run_instance_function(fileManager,
                                             fileManager.uploadFile)
 def checkPasswordToken():
     """ Expects request to have email  """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(
         accountManager, accountManager.checkPasswordToken, getSession=True)
 def list_agencies():
     """ List all CGAC Agencies """
     domainHandler = DomainHandler()
     return RouteUtils.run_instance_function(domainHandler,
                                             domainHandler.listAgencies)
 def update_user():
     """ Updates editable fields for the specified user """
     accountManager = AccountHandler(request, bcrypt=bcrypt)
     return RouteUtils.run_instance_function(accountManager, accountManager.updateUser, getSystemEmail = True)