Exemplo n.º 1
0
def meet_history(request,format=None):                                   # get history of meeting
    user = request.user
    Validator.validate_company(request.GET.get("comp",None), "Please select a company")
    Validator.validate_contact(request.GET.get("contact",None), "Please select a person to contact")
    meetings = External_Meetings.objects.filter(comp_id=request.GET.get("comp", None), contact_id = request.GET.get("contact", None), user = user)
    return Response({'response' : [{ 'open_time': e.open_time ,
                                    'close_time': e.close_time,
                                    'meeting_date': e.meeting_date,
                                     'description' : e.agenda,
                                     'minutes_of_meeting' : e.description} for e in meetings]}, status=status.HTTP_200_OK)
Exemplo n.º 2
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_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_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")