New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show task submit button only to project admins #855
Conversation
@@ -114,7 +114,8 @@ <h3 class="modal-title">{{command | capitalize}} Confirmation</h3> | |||
<div class="container-fluid"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! Just so we don't confuse new users, we'll want to make sure we create the group and add it to the sample workflow data:
- Our docs list the accounts that are created
- This script does the loading
- I think the fix is to
from django.contrib.auth.models import Group
at the top of the script and add something like
project_admins = Group.objects.get_or_create(name='project_admins')
project_admins.user_set.add(user)
after this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, assuming you tested the two lines (even at the console is OK for our purposes)
simple_workflow/load_sample_data.py
Outdated
project_admins.user_set.add(user) | ||
project_admins, created = Group.objects.get_or_create( | ||
name='project_admins') | ||
if created: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even if the group already existed, we should add the user to the group
project_admins.user_set.add(user) | ||
project_admins, created = Group.objects.get_or_create( | ||
name='project_admins') | ||
if created: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment
This PR ensures that task submit button is only visible to project admins now.