Skip to content

Commit

Permalink
Fix/homepage dates (#1831)
Browse files Browse the repository at this point in the history
* reproduce the date error

* fix time

* Fix submission_deadline_str

* Fix submission_deadline_str

* Fix test

* fix test

---------

Co-authored-by: Emilia Rubio <[email protected]>
Co-authored-by: celestemartinez <[email protected]>
  • Loading branch information
3 people authored Sep 12, 2023
1 parent 4405287 commit 9144e51
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion openreview/conference/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ def get_submission_stage(request_forum, venue):
submission_second_due_date = datetime.datetime.strptime(submission_second_due_date, '%Y/%m/%d %H:%M')
except ValueError:
submission_second_due_date = datetime.datetime.strptime(submission_second_due_date, '%Y/%m/%d')
submission_deadline_str = submission_second_due_date.strftime('%b %d %Y %I:%M%p') + ' UTC-0'
submission_due_date = request_forum.content.get('abstract_registration_deadline', '').strip()
if submission_due_date:
try:
Expand All @@ -375,7 +376,6 @@ def get_submission_stage(request_forum, venue):
else:
submission_due_date = submission_second_due_date
submission_second_due_date = None
submission_deadline_str = submission_due_date.strftime('%b %d %Y') + ' UTC-0'
else:
submission_second_due_date = submission_due_date = None

Expand Down
12 changes: 9 additions & 3 deletions tests/test_iclr_conference_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ def profile_management(self, client):
def test_create_conference(self, client, openreview_client, helpers, profile_management):

now = datetime.datetime.utcnow()
abstract_date = now + datetime.timedelta(days=1)
due_date = now + datetime.timedelta(days=3)

# Post the request form note
pc_client=helpers.create_user('[email protected]', 'Program', 'ICLRChair')

sac_client = helpers.create_user('sac1@gmail.com', 'SAC', 'ICLROne')
sac_client = helpers.create_user('sac10@gmail.com', 'SAC', 'ICLROne')
helpers.create_user('[email protected]', 'SAC', 'ICLRTwo')
helpers.create_user('[email protected]', 'AC', 'ICLROne')
helpers.create_user('[email protected]', 'AC', 'ICLRTwo')
Expand Down Expand Up @@ -59,6 +60,7 @@ def test_create_conference(self, client, openreview_client, helpers, profile_man
'senior_area_chairs': 'Yes, our venue has Senior Area Chairs',
'ethics_chairs_and_reviewers': 'Yes, our venue has Ethics Chairs and Reviewers',
'Venue Start Date': '2024/07/01',
'abstract_registration_deadline': abstract_date.strftime('%Y/%m/%d'),
'Submission Deadline': due_date.strftime('%Y/%m/%d'),
'Location': 'Virtual',
'submission_reviewer_assignment': 'Automatic',
Expand Down Expand Up @@ -90,7 +92,9 @@ def test_create_conference(self, client, openreview_client, helpers, profile_man

helpers.await_queue()

assert openreview_client.get_group('ICLR.cc/2024/Conference')
venue_group = openreview_client.get_group('ICLR.cc/2024/Conference')
assert venue_group
assert venue_group.content['date']['value'] == f'Abstract Registration: {abstract_date.strftime("%b %d %Y")} 12:00AM UTC-0, Submission Deadline: {due_date.strftime("%b %d %Y")} 12:00AM UTC-0'
assert openreview_client.get_group('ICLR.cc/2024/Conference/Senior_Area_Chairs')
assert openreview_client.get_group('ICLR.cc/2024/Conference/Area_Chairs')
assert openreview_client.get_group('ICLR.cc/2024/Conference/Reviewers')
Expand Down Expand Up @@ -148,7 +152,8 @@ def test_post_submission(self, client, openreview_client, helpers):

## close the submissions
now = datetime.datetime.utcnow()
due_date = now - datetime.timedelta(minutes=28)
abstract_date = now - datetime.timedelta(minutes=28)
due_date = now + datetime.timedelta(days=3)
pc_client.post_note(openreview.Note(
content={
'title': 'International Conference on Learning Representations',
Expand All @@ -158,6 +163,7 @@ def test_post_submission(self, client, openreview_client, helpers):
'program_chair_emails': ['[email protected]', '[email protected]'],
'contact_email': '[email protected]',
'Venue Start Date': '2024/07/01',
'abstract_registration_deadline': abstract_date.strftime('%Y/%m/%d'),
'Submission Deadline': due_date.strftime('%Y/%m/%d'),
'Location': 'Virtual',
'submission_reviewer_assignment': 'Automatic',
Expand Down

0 comments on commit 9144e51

Please sign in to comment.