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

fix: unify organism_actors behavior across models #289

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions backend/gn_module_monitoring/monitoring/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ def organism_actors(self):
actors_organism_list.append(actor.id_organisme)
elif isinstance(self.digitiser, User):
actors_organism_list.append(self.digitiser.id_organisme)
else:
return
return actors_organism_list

def has_instance_permission(self, scope):
Expand Down Expand Up @@ -197,8 +195,6 @@ def organism_actors(self):
actors_organism_list.append(actor.id_organisme)
elif isinstance(self.digitiser, User):
actors_organism_list.append(self.digitiser.id_organisme)
else:
return actors_organism_list
return actors_organism_list

def has_instance_permission(self, scope):
Expand Down Expand Up @@ -277,7 +273,6 @@ class TMonitoringSites(TBaseSites, PermissionModel, SitesQuery):

@hybrid_property
def organism_actors(self):
# return self.inventor.id_organisme
actors_organism_list = []
if isinstance(self.inventor, list):
for actor in self.inventor:
Expand All @@ -286,6 +281,7 @@ def organism_actors(self):
else:
if hasattr(self.inventor, "id_organisme"):
actors_organism_list.append(self.inventor.id_organisme)
return actors_organism_list

def has_instance_permission(self, scope):
if scope == 0:
Expand Down Expand Up @@ -385,8 +381,6 @@ def organism_actors(self):
actors_organism_list.append(actor.id_organisme)
elif isinstance(self.digitiser, User):
actors_organism_list.append(self.digitiser.id_organisme)
else:
return
return actors_organism_list

def has_instance_permission(self, scope):
Expand Down
Loading