Skip to content

Commit

Permalink
Remove parser function call on date sorting for dates from db (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
edmondsgarrett committed May 18, 2023
1 parent 0f4d061 commit 3bec84b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apcd-cms/src/apps/admin_regis_table/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def _set_modal_content(reg, reg_ent, reg_cont, org_types):

def getDate(row):
date = row[1]
return parser.parse(date) if date is not None else parser.parse('1-1-0001') # put 'None' date entries all together at end of listing
return date if date is not None else parser.parse('1-1-0001') # put 'None' date entries all together at end of listing

registrations_content = sorted(registrations_content, key=lambda row:getDate(row), reverse=True) # sort registrations by newest to oldest

Expand All @@ -237,7 +237,7 @@ def getDate(row):
registration_table_entries.append(_set_registration(registration, associated_entities, associated_contacts))
org_name = registration[7]
if org_name not in context['org_options']:
context['org_options'].append(org_name)
context['org_options'].append(org_name)

status_filter = self.request.GET.get('status')
org_filter = self.request.GET.get('org')
Expand Down

0 comments on commit 3bec84b

Please sign in to comment.