def __validate_input(self, new_user, data): Validator.validate_string(data.get('password'), "Password cannot be empty!") Validator.validate_string(data.get('username'), "Username cannot be empty!") Validator.validate_string(data.get('usertype'), "Usertype cannot be empty!") Validator.validate_zone(data.get('zone'), "Zone cannot be empty!") Validator.validate_string(data.get('name'), "name cannot be empty!") Validator.validate_string(data.get('email'), "Email cannot be empty!") Validator.validate_username(new_user, data.get('username'), "Duplicate Username!") Validator.validate_email(new_user, data.get('email'), "Duplicate Email!")
def validate_input(self, data, meetings): Validator.validate_string(data.get('title'), "Title cannot be empty!") Validator.validate_date(data.get('meeting_date'), "Format of date is incorrect", "Date cannot be empty") Validator.validate_date_today(data.get('meeting_date'), "Date cannot be from past") Validator.validate_time(data.get('open_time'), "Time field cannot be empty") Validator.validate_time(data.get('close_time'), "Time field cannot be empty") Validator.validate_meeting_type(data.get('meeting_type'), "Meeting Type cannot be empty") Validator.validate_meet(data['open_time'], data['close_time'], meetings, "Time slot already booked")
def __validate_updated_input(self, data, meetings, meet_id): # Validator.validate_update(data.get('meeting_date'),data.get('open_time'),"Meeting cannot be updated") Validator.validate_string(data.get('title'), "Title cannot be empty!") Validator.validate_date(data.get('meeting_date'), "Format of date is incorrect", "Date cannot be empty") Validator.validate_time(data.get('open_time'), "Time field cannot be empty") Validator.validate_time(data.get('close_time'), "Time field cannot be empty") Validator.validate_date_today(data.get('meeting_date'), "Date cannot be from past") Validator.validate_meeting_type(data.get('meeting_type'), "Meeting Type cannot be empty") Validator.validate_updated_meet(meet_id, data['open_time'], data['close_time'], meetings, "Time slot already booked") # Validator.validate_meet(data['open_time'], data['close_time'], meetings, "Time slot already booked") Validator.validate_company(data.get('comp_id'), "Please select a company") Validator.validate_contact(data.get('contact_id'), "Please select a person to contact")
def __validate_input(self, data): Validator.validate_string(data.get('title'), "Title cannot be empty!") Validator.validate_date(data.get('travel_date'), "Format of date is incorrect", "Date cannot be empty") Validator.validate_date(data.get('return_date'), "Format of date is incorrect", "Date cannot be empty") Validator.validate_string(data.get('travel_from'), "Location field cannot be empty") Validator.validate_string(data.get('travel_to'), "Location field cannot be empty")