Skip to content

Commit

Permalink
fix contact_email validation (#2382)
Browse files Browse the repository at this point in the history
  • Loading branch information
celestemartinez authored Dec 11, 2024
1 parent 8b837b1 commit 03d796c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion openreview/venue_request/venue_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@ def setup_request_form(self):
},
'contact_email': {
'description': 'Single point of contact email address which will be displayed on the venue page. For example: [email protected]',
'value-regex': r'([a-z0-9_\-\.]{2,}@[a-z0-9_\-\.]{2,}\.[a-z]{2,},){0,}([a-z0-9_\-\.]{2,}@[a-z0-9_\-\.]{2,}\.[a-z]{2,})',
'value-regex': r'[a-z0-9_\-\.]{2,}@[a-z0-9_\-\.]{2,}\.[a-z]{2,}',
'required': True,
'order': 6
},
Expand Down
12 changes: 9 additions & 3 deletions tests/test_venue_request_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def test_venue_deployment(self, client, selenium, request_page, helpers, openrev
due_date = now + datetime.timedelta(minutes=30)
withdraw_exp_date = now + datetime.timedelta(hours=1)

request_form_note = client.post_note(openreview.Note(
request_form_note = openreview.Note(
invitation=support_group_id +'/-/Request_Form',
signatures=['~ProgramChair_User1'],
readers=[
Expand All @@ -196,7 +196,7 @@ def test_venue_deployment(self, client, selenium, request_page, helpers, openrev
'program_chair_emails': [
'[email protected]',
'[email protected]'],
'contact_email': '[email protected]',
'contact_email': '[email protected], [email protected]',
'publication_chairs':'No, our venue does not have Publication Chairs',
'Area Chairs (Metareviewers)': 'No, our venue does not have Area Chairs',
'Venue Start Date': start_date.strftime('%Y/%m/%d'),
Expand All @@ -218,7 +218,13 @@ def test_venue_deployment(self, client, selenium, request_page, helpers, openrev
'submission_name': 'Submission_Test',
'api_version': '2',
'submission_license': ['CC BY 4.0'],
}))
})

with pytest.raises(openreview.OpenReviewException, match=r'contact_email must be a single, valid email address'):
client.post_note(request_form_note)

request_form_note.content['contact_email'] = '[email protected]'
request_form_note = client.post_note(request_form_note)

assert request_form_note
request_page(selenium, 'http://localhost:3030/forum?id=' + request_form_note.forum, client.token)
Expand Down

0 comments on commit 03d796c

Please sign in to comment.