Skip to content

Commit

Permalink
fix machine logging params to fit business logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnetordoff committed Jan 30, 2025
1 parent fac167e commit 188bb52
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions osf/utils/machines.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,16 @@ def save_changes(self, ev):
contributor_permissions = (
self.machineable.requested_permissions or ev.kwargs.get('permissions') or permissions.READ
)
make_curator = self.machineable.request_type == NodeRequestTypes.INSTITUTIONAL_REQUEST.value
visible = False if make_curator else ev.kwargs.get('visible', True)
try:
self.machineable.target.add_contributor(
self.machineable.creator,
auth=Auth(ev.kwargs['user']),
permissions=contributor_permissions,
visible=ev.kwargs.get('visible', True),
visible=visible,
send_email=f'{self.machineable.request_type}_request',
make_curator=self.machineable.request_type == NodeRequestTypes.INSTITUTIONAL_REQUEST.value,
make_curator=make_curator,
)
except IntegrityError as e:
if 'Curators cannot be made bibliographic contributors' in str(e):
Expand Down

0 comments on commit 188bb52

Please sign in to comment.