-
Notifications
You must be signed in to change notification settings - Fork 10
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
Changing behavior for editing accesses #404
Conversation
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.
tested on my local setup. seems to be fulfilling 👍🏻
@@ -89,13 +90,19 @@ class AccessEditView(CheckerMixin, UpdateView, AjaxViewMixin): | |||
permission_target = 'dataset' | |||
|
|||
def form_valid(self, form): | |||
"""If access status is Active, only data stewards can edit it""" | |||
original_object = self.model.objects.get(pk=self.object.id) | |||
if original_object.status == StatusChoices.active and not self.request.user.is_part_of(Groups.DATA_STEWARD.value): |
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.
isnt it the same validation as on line 102?
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.
ah. sorry. Now I see. First is the form as such, second is just status field ;)
works as a charm |
Changed the rules to edit accesses: