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

fix: Use settings.TIME_ZONE when looking up telechat agenda_date() #5020

Merged
merged 2 commits into from
Jan 24, 2023
Merged
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
5 changes: 3 additions & 2 deletions ietf/iesg/agenda.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from ietf.doc.utils_search import fill_in_telechat_date
from ietf.iesg.models import TelechatDate, TelechatAgendaItem
from ietf.review.utils import review_assignments_to_list_for_docs
from ietf.utils.timezone import date_today
from ietf.utils.timezone import date_today, make_aware

def get_agenda_date(date=None):
if not date:
Expand All @@ -26,8 +26,9 @@ def get_agenda_date(date=None):
except IndexError:
return date_today()
else:
parsed_date = make_aware(datetime.datetime.strptime(date, "%Y-%m-%d"), settings.TIME_ZONE).date()
try:
return TelechatDate.objects.active().get(date=datetime.datetime.strptime(date, "%Y-%m-%d").date()).date
return TelechatDate.objects.active().get(date=parsed_date).date
except (ValueError, TelechatDate.DoesNotExist):
raise Http404

Expand Down