Refactoring

* moves updating of shared access users into ShareableObjectMixin
* renames ShareInterventionModalForm to ShareModalForm since it's used for EMA and eco accounts as well
This commit is contained in:
2021-11-16 12:54:28 +01:00
parent bd189c4a54
commit 7f43f197d5
6 changed files with 27 additions and 27 deletions

View File

@@ -284,25 +284,6 @@ class Intervention(BaseObject, ShareableObjectMixin, RecordableObjectMixin, Chec
)
return deduction
def update_sharing_user(self, form):
""" Adds a new user with shared access to the intervention
Args:
form (ShareInterventionModalForm): The form holding the data
Returns:
"""
form_data = form.cleaned_data
keep_accessing_users = form_data["users"]
new_accessing_users = list(form_data["user_select"].values_list("id", flat=True))
accessing_users = keep_accessing_users + new_accessing_users
users = User.objects.filter(
id__in=accessing_users
)
self.share_with_list(users)
class InterventionDocument(AbstractDocument):
"""