Skip to content
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

Merged
merged 5 commits into from Jan 26, 2023

Conversation

adbharadwaj
Copy link
Collaborator

@adbharadwaj adbharadwaj commented Jan 13, 2023

This PR ensures that task submit button is only visible to project admins now.

@@ -114,7 +114,8 @@ <h3 class="modal-title">{{command | capitalize}} Confirmation</h3>
<div class="container-fluid">
Copy link
Member

@marcua marcua Jan 17, 2023

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

Copy link
Member

@marcua marcua left a 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)

@coveralls
Copy link

coveralls commented Jan 20, 2023

Coverage Status

Coverage: 92.55%. Remained the same when pulling 9b951f7 on show-submit-only-admins into db95c57 on main.

project_admins.user_set.add(user)
project_admins, created = Group.objects.get_or_create(
name='project_admins')
if created:
Copy link
Member

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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

@adbharadwaj adbharadwaj merged commit 84f3e55 into main Jan 26, 2023
@adbharadwaj adbharadwaj deleted the show-submit-only-admins branch January 26, 2023 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants