def validate_user_list(form): """Splits emails on the same line, and adds the user creating the list to its managers.""" logger.debug("form.vars: " + str(form.vars)) form.vars.user_list = util.normalize_email_list(form.vars.user_list) form.vars.managers = util.normalize_email_list(form.vars.managers) if auth.user.email not in form.vars.managers: form.vars.managers = [auth.user.email] + form.vars.managers
def f(form): """Validates the form venue, splitting managers listed on the same line.""" if is_real_manager: form.vars.managers = util.normalize_email_list(form.vars.managers) form.vars.observers = util.normalize_email_list(form.vars.observers) if raters_equal_submitters: form.vars.rate_constraint = form.vars.submit_constraint if get_user_email() not in form.vars.managers: form.vars.managers = [get_user_email()] + form.vars.managers # Checks the dates. if form.vars.open_date is None: form.errors.open_date = T('The date is required.') if form.vars.close_date is None: form.errors.close_date = T('The date is required.') if form.vars.rate_open_date is None: form.errors.rate_open_date = T('The date is required.') if form.vars.rate_close_date is None: form.errors.rate_close_date = T('The date is required.') if not (form.errors.open_date or form.errors.close_date or form.errors.rate_open_date or form.errors.rate_close_date): if form.vars.close_date < form.vars.open_date: form.errors.close_date = T('The submission deadline must follow the submission opening date.') if form.vars.rate_open_date < form.vars.close_date: form.errors.rate_open_date = T('The review start date must follow the submission deadline.') if form.vars.rate_close_date < form.vars.rate_open_date: form.errors.rate_close_date = T('The review deadline must follow the review starting date.') # If there are no errors, updates the descriptions. if not form.errors: if c is not None: form.vars.description = keystore_update(c.description, form.vars.description) form.vars.submission_instructions = keystore_update(c.submission_instructions, form.vars.submission_instructions) form.vars.grading_instructions = keystore_update(c.grading_instructions, form.vars.grading_instructions) else: form.vars.description = keystore_write(form.vars.description) form.vars.submission_instructions = keystore_write(form.vars.submission_instructions) form.vars.grading_instructions = keystore_write(form.vars.grading_instructions)
def validate_user_list(form): """Splits emails on the same line, and adds the user creating the list to its managers.""" logger.debug("form.vars: " + str(form.vars)) form.vars.user_list = util.normalize_email_list(form.vars.user_list) form.vars.managers = util.normalize_email_list(form.vars.managers) if get_user_email() not in form.vars.managers: form.vars.managers = [get_user_email()] + form.vars.managers
def f(form): """Validates the form venue, splitting managers listed on the same line.""" form.vars.managers = util.normalize_email_list(form.vars.managers) form.vars.observers = util.normalize_email_list(form.vars.observers) if raters_equal_submitters: form.vars.rate_constraint = form.vars.submit_constraint if auth.user.email not in form.vars.managers: form.vars.managers = [auth.user.email] + form.vars.managers
def f(form): """Validates the form venue, splitting managers listed on the same line.""" if is_real_manager: form.vars.managers = util.normalize_email_list(form.vars.managers) form.vars.observers = util.normalize_email_list( form.vars.observers) if raters_equal_submitters: form.vars.rate_constraint = form.vars.submit_constraint if get_user_email() not in form.vars.managers: form.vars.managers = [get_user_email()] + form.vars.managers # Checks the dates. if form.vars.open_date is None: form.errors.open_date = T('The date is required.') if form.vars.close_date is None: form.errors.close_date = T('The date is required.') if form.vars.rate_open_date is None: form.errors.rate_open_date = T('The date is required.') if form.vars.rate_close_date is None: form.errors.rate_close_date = T('The date is required.') if not (form.errors.open_date or form.errors.close_date or form.errors.rate_open_date or form.errors.rate_close_date): if form.vars.close_date < form.vars.open_date: form.errors.close_date = T( 'The submission deadline must follow the submission opening date.' ) if form.vars.rate_open_date < form.vars.close_date: form.errors.rate_open_date = T( 'The review start date must follow the submission deadline.' ) if form.vars.rate_close_date < form.vars.rate_open_date: form.errors.rate_close_date = T( 'The review deadline must follow the review starting date.' ) # If there are no errors, updates the descriptions. if not form.errors: if c is not None: form.vars.description = keystore_update( c.description, form.vars.description) form.vars.submission_instructions = keystore_update( c.submission_instructions, form.vars.submission_instructions) form.vars.grading_instructions = keystore_update( c.grading_instructions, form.vars.grading_instructions) else: form.vars.description = keystore_write( form.vars.description) form.vars.submission_instructions = keystore_write( form.vars.submission_instructions) form.vars.grading_instructions = keystore_write( form.vars.grading_instructions)
def validate_venue(form): """Validates the form venue, splitting managers listed on the same line.""" form.vars.managers = util.normalize_email_list(form.vars.managers) form.vars.observers = util.normalize_email_list(form.vars.observers) if auth.user.email not in form.vars.managers: form.vars.managers = [auth.user.email] + form.vars.managers