Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into institutional-access-insti-admin-validation

* 'develop' of https://github.com/CenterForOpenScience/osf.io:
  Add view, form to update moderation state
  • Loading branch information
John Tordoff committed Jan 9, 2025
2 parents 8171f74 + 5941492 commit 9a72225
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions osf/utils/machines.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,14 @@ def save_changes(self, ev):
if ev.event.name == DefaultTriggers.ACCEPT.value:
if not self.machineable.target.is_contributor(self.machineable.creator):
contributor_permissions = ev.kwargs.get('permissions', permissions.READ)
make_curator = True if self.machineable.request_type == NodeRequestTypes.INSTITUTIONAL_REQUEST.value else False
try:
self.machineable.target.add_contributor(
self.machineable.creator,
auth=Auth(ev.kwargs['user']),
permissions=contributor_permissions,
visible=ev.kwargs.get('visible', True),
send_email=f'{self.machineable.request_type}_request',
make_curator=make_curator,
make_curator=self.machineable.request_type == NodeRequestTypes.INSTITUTIONAL_REQUEST.value,
)
except IntegrityError as e:
if 'Curators cannot be made bibliographic contributors' in str(e):
Expand Down

0 comments on commit 9a72225

Please sign in to comment.