Repository: openreview/openreview-py (language: python)

Issue:
Remove desk-rejected authors from authors/Accepted
The desk-rejection process function removes the authors from /Authors group, but not from the /Authors/Accepted group.


Discussion / hints:

Fix patch:
diff --git a/openreview/venue/process/desk_rejected_submission_process.py b/openreview/venue/process/desk_rejected_submission_process.py
index 92e402940..eaac69c15 100644
--- a/openreview/venue/process/desk_rejected_submission_process.py
+++ b/openreview/venue/process/desk_rejected_submission_process.py
@@ -14,6 +14,7 @@ def process(client, edit, invitation):
     desk_rejection_email_pcs = domain.content.get('desk_rejection_email_pcs', {}).get('value')
     program_chairs_id = domain.content['program_chairs_id']['value']
     sender = domain.get_content_value('message_sender')
+    authors_accepted_id = domain.get_content_value('authors_accepted_id')
 
     submission = client.get_note(edit.note.id)
     paper_group_id=f'{venue_id}/{submission_name}{submission.number}'
@@ -51,6 +52,7 @@ def process(client, edit, invitation):
 
     print(f'Remove {paper_group_id}/{authors_name} from {venue_id}/{authors_name}')
     client.remove_members_from_group(f'{venue_id}/{authors_name}', f'{paper_group_id}/{authors_name}')
+    client.remove_members_from_group(authors_accepted_id, f'{paper_group_id}/{authors_name}')
 
     formatted_committee = [committee.format(number=submission.number) for committee in desk_reject_committee]
     final_committee = []
diff --git a/openreview/venue/process/desk_rejection_reversion_submission_process.py b/openreview/venue/process/desk_rejection_reversion_submission_process.py
index d749b7eaa..dfaf7b024 100644
--- a/openreview/venue/process/desk_rejection_reversion_submission_process.py
+++ b/openreview/venue/process/desk_rejection_reversion_submission_process.py
@@ -11,6 +11,7 @@ def process(client, edit, invitation):
     submission_name = domain.content['submission_name']['value']
     authors_name = domain.content['authors_name']['value']
     sender = domain.get_content_value('message_sender')
+    decision_name = domain.get_content_value('decision_name')
 
     now = openreview.tools.datetime_millis(datetime.datetime.utcnow())
     submission = client.get_note(edit.note.forum)
@@ -52,4 +53,12 @@ def process(client, edit, invitation):
     client.post_message(email_subject, final_committee, email_body, invitation=meta_invitation_id, signature=venue_id, replyTo=contact, sender=sender)
 
     print(f'Add {paper_group_id}/{authors_name} to {venue_id}/{authors_name}')
-    client.add_members_to_group(f'{venue_id}/{authors_name}', f'{paper_group_id}/{authors_name}')
\ No newline at end of file
+    client.add_members_to_group(f'{venue_id}/{authors_name}', f'{paper_group_id}/{authors_name}')
+
+    if decision_name:
+        decision = client.get_notes(forum=submission.id, invitation=f'{venue_id}/{submission_name}{submission.number}/-/{decision_name}')
+        accept_options = domain.get_content_value('accept_decision_options')
+        if decision and openreview.tools.is_accept_decision(decision[0].content['decision']['value'], accept_options):
+            authors_accepted_id = domain.get_content_value('authors_accepted_id')
+            print(f'Add {paper_group_id}/{authors_name} to {authors_accepted_id}')
+            client.add_members_to_group(authors_accepted_id, f'{paper_group_id}/{authors_name}')
\ No newline at end of file
diff --git a/openreview/venue/process/withdrawal_reversion_submission_process.py b/openreview/venue/process/withdrawal_reversion_submission_process.py
index 681551386..553f7881f 100644
--- a/openreview/venue/process/withdrawal_reversion_submission_process.py
+++ b/openreview/venue/process/withdrawal_reversion_submission_process.py
@@ -11,6 +11,7 @@ def process(client, edit, invitation):
     submission_name = domain.content['submission_name']['value']
     authors_name = domain.content['authors_name']['value']
     sender = domain.get_content_value('message_sender')
+    decision_name = domain.get_content_value('decision_name')
 
     now = openreview.tools.datetime_millis(datetime.datetime.utcnow())
     submission = client.get_note(edit.note.forum)
@@ -52,4 +53,12 @@ def process(client, edit, invitation):
     client.post_message(email_subject, final_committee, email_body, invitation=meta_invitation_id, signature=venue_id, replyTo=contact, sender=sender)
 
     print(f'Add {paper_group_id}/{authors_name} to {venue_id}/{authors_name}')
-    client.add_members_to_group(f'{venue_id}/{authors_name}', f'{paper_group_id}/{authors_name}')
\ No newline at end of file
+    client.add_members_to_group(f'{venue_id}/{authors_name}', f'{paper_group_id}/{authors_name}')
+
+    if decision_name:
+        decision = client.get_notes(forum=submission.id, invitation=f'{venue_id}/{submission_name}{submission.number}/-/{decision_name}')
+        accept_options = domain.get_content_value('accept_decision_options')
+        if decision and openreview.tools.is_accept_decision(decision[0].content['decision']['value'], accept_options):
+            authors_accepted_id = domain.get_content_value('authors_accepted_id')
+            print(f'Add {paper_group_id}/{authors_name} to {authors_accepted_id}')
+            client.add_members_to_group(authors_accepted_id, f'{paper_group_id}/{authors_name}')
\ No newline at end of file
diff --git a/openreview/venue/process/withdrawn_submission_process.py b/openreview/venue/process/withdrawn_submission_process.py
index 2255ba41a..46717ca17 100644
--- a/openreview/venue/process/withdrawn_submission_process.py
+++ b/openreview/venue/process/withdrawn_submission_process.py
@@ -14,6 +14,7 @@ def process(client, edit, invitation):
     withdrawal_email_pcs = domain.content.get('withdrawal_email_pcs', {}).get('value')
     program_chairs_id = domain.content['program_chairs_id']['value']
     sender = domain.get_content_value('message_sender')
+    authors_accepted_id = domain.get_content_value('authors_accepted_id')
 
     submission = client.get_note(edit.note.id)
     paper_group_id=f'{venue_id}/{submission_name}{submission.number}'    
@@ -48,6 +49,7 @@ def process(client, edit, invitation):
 
     print(f'Remove {paper_group_id}/{authors_name} from {venue_id}/{authors_name}')
     client.remove_members_from_group(f'{venue_id}/{authors_name}', f'{paper_group_id}/{authors_name}')
+    client.remove_members_from_group(authors_accepted_id, f'{paper_group_id}/{authors_name}')
 
     formatted_committee = [committee.format(number=submission.number) for committee in withdraw_committee]
     final_committee = []


Test patch:
diff --git a/tests/test_venue_request_v2.py b/tests/test_venue_request_v2.py
index 39a44bd22..57e06d61f 100644
--- a/tests/test_venue_request_v2.py
+++ b/tests/test_venue_request_v2.py
@@ -3540,6 +3540,9 @@ def test_submission_withdrawal(self, client, openreview_client, helpers, test_cl
 
         helpers.await_queue_edit(openreview_client, invitation='V2.cc/2030/Conference/-/Withdrawn_Submission')
 
+        authors_accepted_group = openreview_client.get_group('V2.cc/2030/Conference/Authors/Accepted')
+        assert 'V2.cc/2030/Conference/Submission1/Authors' not in authors_accepted_group.members
+
         pc_openreview_client = openreview.api.OpenReviewClient(username='tom_venue@mail.com', password=helpers.strong_password)
 
         # reverse withdrawal
@@ -3560,6 +3563,9 @@ def test_submission_withdrawal(self, client, openreview_client, helpers, test_cl
         assert 'readers' not in note.content['authors']
         assert 'readers' not in note.content['authorids']
 
+        authors_accepted_group = openreview_client.get_group('V2.cc/2030/Conference/Authors/Accepted')
+        assert 'V2.cc/2030/Conference/Submission1/Authors' in authors_accepted_group.members
+
         #desk-reject paper
         desk_reject_note = pc_openreview_client.post_note_edit(invitation=f'V2.cc/2030/Conference/Submission1/-/Desk_Rejection',
                                     signatures=['V2.cc/2030/Conference/Program_Chairs'],
@@ -3589,6 +3595,9 @@ def test_submission_withdrawal(self, client, openreview_client, helpers, test_cl
 
         helpers.await_queue_edit(openreview_client, invitation='V2.cc/2030/Conference/-/Desk_Rejected_Submission')
 
+        authors_accepted_group = openreview_client.get_group('V2.cc/2030/Conference/Authors/Accepted')
+        assert 'V2.cc/2030/Conference/Submission1/Authors' not in authors_accepted_group.members
+
         # reverse desk-rejection
         desk_rejection_reversion_note = pc_openreview_client.post_note_edit(invitation='V2.cc/2030/Conference/Submission1/-/Desk_Rejection_Reversion',
                                     signatures=['V2.cc/2030/Conference/Program_Chairs'],
@@ -3607,6 +3616,9 @@ def test_submission_withdrawal(self, client, openreview_client, helpers, test_cl
         assert 'readers' not in note.content['authors']
         assert 'readers' not in note.content['authorids']
 
+        authors_accepted_group = openreview_client.get_group('V2.cc/2030/Conference/Authors/Accepted')
+        assert 'V2.cc/2030/Conference/Submission1/Authors' in authors_accepted_group.members
+
     def test_accepted_papers_meta_review_ratings(self, client, test_client, helpers, venue, openreview_client):
 
         venue = openreview.get_conference(client, venue['request_form_note'].id, support_user='openreview.net/Support')