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

Issue:
Venue Recruitment: updating the invitation content
We only update the invitation content when the reduced load has changed, but even then we only repost the new reduced load. This means that the fields `overlap_committee_id` and `overlap_committee_name` are never updated, even if the PCs change this in the request form recruitment:

https://github.com/openreview/openreview-py/blob/c448f3cc285675879f6576abcc71ece9dd035ddb/openreview/venue/invitation.py#L769


Discussion / hints:
We should check if these values change and add the changes to the edit!

Fix patch:
diff --git a/openreview/venue/invitation.py b/openreview/venue/invitation.py
index d338f9b3b..81f1a8510 100644
--- a/openreview/venue/invitation.py
+++ b/openreview/venue/invitation.py
@@ -741,7 +741,7 @@ def set_recruitment_invitation(self, committee_name, options):
         invitation_id=venue.get_recruitment_id(venue.get_committee_id(name=committee_name))
         current_invitation=tools.get_invitation(self.client, id = invitation_id)
 
-        #if reduced_load hasn't change, no need to repost invitation
+        #if invitation does not exist, post it
         if not current_invitation:
             recruitment_invitation = Invitation(
                 id = invitation_id,
@@ -769,20 +769,26 @@ def set_recruitment_invitation(self, committee_name, options):
         else:
             print('current invitation', current_invitation.edit['note']['content'].get('reduced_load', {}))
             print('new invitation', reduced_load_dict)
+            updated_invitation = Invitation(
+                id = invitation_id
+            )
             if current_invitation.edit['note']['content'].get('reduced_load', {}) != reduced_load_dict:
-                print('update reduce load')
-                return self.save_invitation(Invitation(
-                    id = invitation_id,
-                    edit = {
-                        'note' : {
-                            'content': {
-                                'reduced_load': reduced_load_dict if reduced_load_dict else { 'delete': True }
-                            }
+                updated_invitation.edit = {
+                    'note': {
+                        'content' : {
+                            'reduced_load': reduced_load_dict if reduced_load_dict else { 'delete': True }
                         }
                     }
-                ))
+                }
+            if 'overlap_committee_name' in invitation_content and current_invitation.edit['note']['content'].get('overlap_committee_name', {}) != invitation_content['overlap_committee_name']:
+                updated_invitation.content = {
+                    'overlap_committee_name': invitation_content['overlap_committee_name'],
+                    'overlap_committee_id': invitation_content['overlap_committee_id']
+                }
+            if updated_invitation.content or updated_invitation.edit.get('note', {}):
+                return self.save_invitation(updated_invitation)
             else:
-                print('do not update reduce load')
+                print('do not update recruitment invitation')
                 return current_invitation
 
     def set_bid_invitations(self):


Test patch:
diff --git a/tests/test_venue_submission.py b/tests/test_venue_submission.py
index f7ec7041f..3550d1050 100644
--- a/tests/test_venue_submission.py
+++ b/tests/test_venue_submission.py
@@ -139,6 +139,10 @@ def test_recruitment_stage(self, venue, openreview_client, selenium, request_pag
             contact_info='testvenue@contact.com',
             allow_overlap_official_committee = True)
 
+        recruitment_inv = openreview_client.get_invitation('TestVenue.cc/Area_Chairs/-/Recruitment')
+        assert 'overlap_committee_name' not in recruitment_inv.content
+        assert 'reduced_load' not in recruitment_inv.edit['note']['content']
+
         messages = openreview_client.get_messages(to='reviewer_venue_one@mail.com')
         assert messages
         invitation_url = re.search('https://.*\n', messages[1]['content']['text']).group(0).replace('https://openreview.net', 'http://localhost:3030')[:-1]
@@ -146,7 +150,19 @@ def test_recruitment_stage(self, venue, openreview_client, selenium, request_pag
 
         reviewer_group = openreview_client.get_group('TestVenue.cc/Reviewers')
         assert reviewer_group
-        assert '~Reviewer_Venue_One1' in reviewer_group.members    
+        assert '~Reviewer_Venue_One1' in reviewer_group.members
+
+        venue.recruit_reviewers(title='[TV 22] Invitation to serve as Area Chair',
+            message=message,
+            invitees = ['celeste@email.com'],
+            reviewers_name = 'Area_Chairs',
+            contact_info='testvenue@contact.com',
+            allow_overlap_official_committee = False,
+            reduced_load_on_decline = ['1', '2'])
+
+        recruitment_inv = openreview_client.get_invitation('TestVenue.cc/Area_Chairs/-/Recruitment')
+        assert 'overlap_committee_name' in recruitment_inv.content and recruitment_inv.content['overlap_committee_name']['value'] == 'Reviewers'
+        assert 'reduced_load' in recruitment_inv.edit['note']['content'] and recruitment_inv.edit['note']['content']['reduced_load']['value']['param']['enum'] == ['1', '2']
     
     def test_submission_stage(self, venue, openreview_client, helpers):