From 77a28404cf6432dd84819b917e166229254eb96e Mon Sep 17 00:00:00 2001 From: pooja allampallewar Date: Tue, 31 Jan 2023 22:03:44 +0530 Subject: [PATCH] Correct complaint spelling mistake in all files. --- constants/statuses.py | 4 ++-- models/complaint.py | 2 +- views/complaint.py | 20 ++++++++++---------- views/constant.py | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/constants/statuses.py b/constants/statuses.py index adcd7b0..ca3eebf 100644 --- a/constants/statuses.py +++ b/constants/statuses.py @@ -15,7 +15,7 @@ NON_DINING = "nd" INTERNATIONAL = "inl" -COMLAINT_STATUSES = [ +COMPLAINT_STATUSES = [ (RESOLVED, "Resolved"), (PENDING, "Pending"), (UNRESOLVED, "Unresolved"), @@ -35,7 +35,7 @@ (INTERNATIONAL, "INTERNATIONAL STUDENT") ] -COMLAINT_STATUSES_MAP = { +COMPLAINT_STATUSES_MAP = { 'RESOLVED': RESOLVED, 'UNRESOLVED': UNRESOLVED, 'PENDING': PENDING, diff --git a/models/complaint.py b/models/complaint.py index eedb511..b72cdbe 100644 --- a/models/complaint.py +++ b/models/complaint.py @@ -26,7 +26,7 @@ class Complaint(Model): default=complaint_types.OTHER, ) status = models.CharField( - max_length=10, choices=statuses.COMLAINT_STATUSES, default=statuses.PENDING + max_length=10, choices=statuses.COMPLAINT_STATUSES, default=statuses.PENDING ) description = models.TextField() failed_attempts = models.PositiveIntegerField( diff --git a/views/complaint.py b/views/complaint.py index aadcb01..979f2b9 100644 --- a/views/complaint.py +++ b/views/complaint.py @@ -152,7 +152,7 @@ def apply_filters(self, request): """ if 'status' in params.keys(): status_list = params.getlist('status') - mapping = statuses.COMLAINT_STATUSES_MAP + mapping = statuses.COMPLAINT_STATUSES_MAP status_codes = [\ mapping[key] for key in status_list\ if key in mapping.keys()\ @@ -227,16 +227,16 @@ def download(self, request, hostel__code): 'Unsuccesful attempts': [], 'Status': [], } - for complain in queryset: + for complaint in queryset: try: - data['Applicant Name'].append(complain.resident.person.full_name) - data['Complaint Date'].append(complain.datetime_created.strftime("%I:%M%p %d%b%Y")) - data['Complaint Type'].append(complain.get_complaint_type_display()) - data['Description'].append(complain.description) - data['Contact No.'].append(get_phone_number(complain.resident)) - data['Applicant Room'].append(complain.resident.room_number) - data['Unsuccesful attempts'].append(complain.failed_attempts) - data['Status'].append(complain.get_status_display()) + data['Applicant Name'].append(complaint.resident.person.full_name) + data['Complaint Date'].append(complaint.datetime_created.strftime("%I:%M%p %d%b%Y")) + data['Complaint Type'].append(complaint.get_complaint_type_display()) + data['Description'].append(complaint.description) + data['Contact No.'].append(get_phone_number(complaint.resident)) + data['Applicant Room'].append(complaint.resident.room_number) + data['Unsuccesful attempts'].append(complaint.failed_attempts) + data['Status'].append(complaint.get_status_display()) except IndexError: pass diff --git a/views/constant.py b/views/constant.py index 020bd62..80970f6 100644 --- a/views/constant.py +++ b/views/constant.py @@ -48,7 +48,7 @@ def list(self, request): mapping = complaint_items.COMPLAINT_ITEMS_MAP reverse_complaint_items_map = \ {mapping[key]: key for key in mapping.keys()} - mapping = statuses.COMLAINT_STATUSES_MAP + mapping = statuses.COMPLAINT_STATUSES_MAP reverse_complaint_statuses_map = \ {mapping[key]: key for key in mapping.keys()} mapping = statuses.BOOKING_STATUSES_MAP @@ -79,7 +79,7 @@ def list(self, request): response['complaint_types'] = reverse_complaint_types_map response['complaint_items'] = reverse_complaint_items_map response['statues'] = { - 'COMLAINT_STATUSES': reverse_complaint_statuses_map, + 'COMPLAINT_STATUSES': reverse_complaint_statuses_map, 'BOOKING_STATUSES': reverse_booking_statuses_map, 'FEE_TYPES': reverse_fee_types_map, }