Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct complaint spelling mistake in all files. #42

Merged
merged 1 commit into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions constants/statuses.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
NON_DINING = "nd"
INTERNATIONAL = "inl"

COMLAINT_STATUSES = [
COMPLAINT_STATUSES = [
(RESOLVED, "Resolved"),
(PENDING, "Pending"),
(UNRESOLVED, "Unresolved"),
Expand All @@ -35,7 +35,7 @@
(INTERNATIONAL, "INTERNATIONAL STUDENT")
]

COMLAINT_STATUSES_MAP = {
COMPLAINT_STATUSES_MAP = {
'RESOLVED': RESOLVED,
'UNRESOLVED': UNRESOLVED,
'PENDING': PENDING,
Expand Down
2 changes: 1 addition & 1 deletion models/complaint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
20 changes: 10 additions & 10 deletions views/complaint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()\
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions views/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
}
Expand Down