示例#1
0
 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")
示例#2
0
 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")