Skip to content

Commit

Permalink
Fix for additional routes.
Browse files Browse the repository at this point in the history
  • Loading branch information
kbecker42 committed Aug 15, 2022
1 parent a9a0b14 commit 5f13be5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pybossa/view/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -3215,6 +3215,8 @@ def add_coowner(short_name, user_name=None):
if user.id in project.owners_ids:
flash(gettext('User is already an owner'), 'warning')
else:
auditlogger.log_event(project, current_user, 'update',
'project.coowners', project.owners_ids, project.owners_ids + [user.id])
project.owners_ids.append(user.id)
project_repo.update(project)
flash(gettext('User was added to list of owners'), 'success')
Expand All @@ -3238,8 +3240,11 @@ def del_coowner(short_name, user_name=None):
elif user.id not in project.owners_ids:
flash(gettext('User is not a project owner'), 'error')
else:
old_list = project.owners_ids.copy()
project.owners_ids.remove(user.id)
project_repo.update(project)
auditlogger.log_event(project, current_user, 'update',
'project.coowners', old_list, project.owners_ids)
flash(gettext('User was deleted from the list of owners'),
'success')
return redirect_content_type(url_for('.coowners', short_name=short_name))
Expand Down

0 comments on commit 5f13be5

Please sign in to comment.