From 05032a9fec5f21db633f055b5b7e8f18ed4b437f Mon Sep 17 00:00:00 2001 From: Kateryna Stetsenko Date: Wed, 6 Nov 2024 08:44:12 -0800 Subject: [PATCH 1/4] added '%Y%m%d'instead of DATE_FORMAT_YMD --- candidate/views_admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/candidate/views_admin.py b/candidate/views_admin.py index d3609d9e8..ceff3fbdb 100644 --- a/candidate/views_admin.py +++ b/candidate/views_admin.py @@ -1316,7 +1316,7 @@ def candidate_list_view(request): # datetime_now = timezone.localize(datetime.now()) timezone, datetime_now = generate_localized_datetime_from_obj() if positive_value_exists(election.election_day_text): - date_of_election = timezone.localize(datetime.strptime(election.election_day_text, DATE_FORMAT_YMD)) # "%Y-%m-%d" + date_of_election = timezone.localize(datetime.strptime(election.election_day_text, '%Y%m%d')) # "%Y-%m-%d" if date_of_election > datetime_now: time_until_election = date_of_election - datetime_now election.days_until_election = convert_to_int(DATE_FORMAT_DAY_TWO_DIGIT % time_until_election.days) # "%d" From dcabe77294c8260e0dee5ae7bae6315142bbc27b Mon Sep 17 00:00:00 2001 From: Kateryna Stetsenko Date: Wed, 6 Nov 2024 08:45:03 -0800 Subject: [PATCH 2/4] added argument self to def process_exception --- wevote_social/middleware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wevote_social/middleware.py b/wevote_social/middleware.py index ca45e8a4a..5873dbd6b 100644 --- a/wevote_social/middleware.py +++ b/wevote_social/middleware.py @@ -69,7 +69,7 @@ def __call__(self, request): return response - def process_exception(request, exception): + def process_exception(self, request, exception): # if hasattr(social_exceptions, exception.__class__.__name__): # if exception.__class__.__name__ == 'AuthAlreadyAssociated': # return HttpResponse("AuthAlreadyAssociated: %s" % exception) From 7344f3298c59cc96c22e40f0355f225e749b69ac Mon Sep 17 00:00:00 2001 From: Kateryna Stetsenko Date: Wed, 6 Nov 2024 09:28:35 -0800 Subject: [PATCH 3/4] Updated office_held_summary URL pattern to accept numeric IDs, added[0-9] --- office_held/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/office_held/urls.py b/office_held/urls.py index 76336603c..acb785152 100644 --- a/office_held/urls.py +++ b/office_held/urls.py @@ -22,7 +22,7 @@ re_path(r'^real_time_status/$', views_admin.office_held_update_status, name='office_held_update_status'), re_path(r'^repair_ocd_id_mismatch/$', views_admin.repair_ocd_id_mismatch_damage_view, name='repair_ocd_id_mismatch'), - re_path(r'^(?Pwv[\w]{2}officeheld[\w]+)/summary/$', + re_path(r'^(?P[0-9]+)/summary/$', views_admin.office_held_summary_view, name='office_held_summary'), re_path(r'^update_ocd_id_state_mismatch/', views_admin.update_ocd_id_state_mismatch_view, name='update_ocd_id_state_mismatch'), From d6c6f08cce00dff028b27e68a6164ce6e93f0a90 Mon Sep 17 00:00:00 2001 From: Kateryna Stetsenko Date: Wed, 6 Nov 2024 10:48:30 -0800 Subject: [PATCH 4/4] in this files changed wv[\w]{2}..[\w] to [0-9] --- google_custom_search/urls.py | 4 ++-- image/urls.py | 2 +- office_held/urls.py | 2 +- organization/urls.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/google_custom_search/urls.py b/google_custom_search/urls.py index 224d2ecbd..685528af9 100644 --- a/google_custom_search/urls.py +++ b/google_custom_search/urls.py @@ -10,14 +10,14 @@ # views_admin re_path(r'^delete_possible_twitter_handles/(?Pwv[\w]{2}cand[\w]+)/$', views_admin.delete_possible_google_search_users_view, name='delete_possible_google_search_users',), - re_path(r'^retrieve_possible_google_search_users/(?Pwv[\w]{2}cand[\w]+)/$', + re_path(r'^retrieve_possible_google_search_users/(?P[0-9]+)/$', views_admin.retrieve_possible_google_search_users_view, name='retrieve_possible_google_search_users',), re_path(r'^possible_google_search_user_do_not_match/$', views_admin.possible_google_search_user_do_not_match_view, name='possible_google_search_user_do_not_match',), re_path(r'^bulk_retrieve_possible_google_search_users/$', views_admin.bulk_retrieve_possible_google_search_users_view, name='bulk_retrieve_possible_google_search_users',), - re_path(r'^bulk_possible_google_search_users_do_not_match/(?Pwv[\w]{2}cand[\w]+)/$', + re_path(r'^bulk_possible_google_search_users_do_not_match/(?P[0-9]+)/$', views_admin.bulk_possible_google_search_users_do_not_match_view, name='bulk_possible_google_search_users_do_not_match',), ] diff --git a/image/urls.py b/image/urls.py index 6463c3a1b..296ffc290 100644 --- a/image/urls.py +++ b/image/urls.py @@ -17,7 +17,7 @@ views_admin.create_resized_images_for_organization_view, name='create_resized_images_for_organization'), re_path(r'^(?P[0-9]+)/create_resized_images_for_voters/$', views_admin.create_resized_images_for_voters_view, name='create_resized_images_for_voters'), - re_path(r'^(?Pwv[\w]{2}cand[\w]+)/images_for_one_candidate/$', + re_path(r'^(?P[0-9]+)/images_for_one_candidate/$', views_admin.images_for_one_candidate_view, name='images_for_one_candidate'), re_path(r'^(?Pwv[\w]{2}org[\w]+)/images_for_one_organization/$', views_admin.images_for_one_organization_view, name='images_for_one_organization'), diff --git a/office_held/urls.py b/office_held/urls.py index acb785152..39a0a8b14 100644 --- a/office_held/urls.py +++ b/office_held/urls.py @@ -22,7 +22,7 @@ re_path(r'^real_time_status/$', views_admin.office_held_update_status, name='office_held_update_status'), re_path(r'^repair_ocd_id_mismatch/$', views_admin.repair_ocd_id_mismatch_damage_view, name='repair_ocd_id_mismatch'), - re_path(r'^(?P[0-9]+)/summary/$', + re_path(r'^(?P[\w]+)/summary/$', views_admin.office_held_summary_view, name='office_held_summary'), re_path(r'^update_ocd_id_state_mismatch/', views_admin.update_ocd_id_state_mismatch_view, name='update_ocd_id_state_mismatch'), diff --git a/organization/urls.py b/organization/urls.py index 7c2cddd3f..29ce4df1d 100644 --- a/organization/urls.py +++ b/organization/urls.py @@ -47,7 +47,7 @@ views_admin.organization_position_new_view, name='organization_position_new', ), re_path(r'^(?P[0-9]+)/pos/(?Pwv[\w]{2}pos[\w]+)/delete/$', views_admin.organization_delete_existing_position_process_form_view, name='organization_position_delete', ), - re_path(r'^(?P[0-9]+)/pos/(?Pwv[\w]{2}pos[\w]+)/$', + re_path(r'^(?P[0-9]+)/pos/(?P[0-9]+)/$', views_admin.organization_position_edit_view, name='organization_position_edit', ), re_path(r'^(?Pwv[\w]{2}org[\w]+)/pos/(?Pwv[\w]{2}pos[\w]+)/$', views_admin.organization_position_edit_view, name='organization_we_vote_id_position_edit', ),