Skip to content

Commit

Permalink
Fix/ Venue: remove duplicates when adding authors to authors group (#…
Browse files Browse the repository at this point in the history
…1781)

* remove duplicated when adding authors to authors group

* add test

---------

Co-authored-by: Melisa Bok <[email protected]>
  • Loading branch information
celestemartinez and melisabok authored Jul 24, 2023
1 parent f94e187 commit da635d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion openreview/venue/process/submission_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def process(client, edit, invitation):
writers=[venue_id],
signatures=[venue_id],
signatories=[venue_id, authors_group_id],
members=note.content['authorids']['value'] ## always update authors
members=list(set(note.content['authorids']['value'])) ## always update authors
)
)
if action == 'posted' or action == 'updated':
Expand Down
7 changes: 4 additions & 3 deletions tests/test_venue_submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ def test_submission_stage(self, venue, openreview_client, helpers):
note=Note(id=submission.id,
content={
'title': { 'value': 'Paper 1 Title UPDATED' },
'authors': { 'value': ['Celeste MartinezEleven']},
'authorids': { 'value': ['~Celeste_MartinezEleven1']},
'authors': { 'value': ['Celeste MartinezEleven', 'Celeste MartinezTwelve']},
'authorids': { 'value': ['~Celeste_MartinezEleven1', '~Celeste_MartinezEleven1']},
'pdf': {'value': '/pdf/' + 'p' * 40 +'.pdf' },
'keywords': {'value': ['aa'] }
}
Expand All @@ -222,7 +222,8 @@ def test_submission_stage(self, venue, openreview_client, helpers):
assert len(messages) == 1
assert 'Your submission to TV 22 has been updated.' in messages[0]['content']['text']

#TODO: check author console
authors_group = openreview_client.get_group('TestVenue.cc/Submission1/Authors')
assert len(authors_group.members) == 1 and ['~Celeste_MartinezEleven1'] == authors_group.members

with pytest.raises(openreview.OpenReviewException, match=r'authorids value/1 must match pattern "~.*"'):
submission_note_2 = author_client.post_note_edit(
Expand Down

0 comments on commit da635d4

Please sign in to comment.