Skip to content

Commit

Permalink
fix(access): org mixin get_obj_org not to call get_object
Browse files Browse the repository at this point in the history
ref: #471 #511
  • Loading branch information
jon-nfc committed Feb 1, 2025
1 parent b6593c6 commit a4788ab
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/access/mixins/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,16 @@ def get_obj_organization(self, obj = None, request = None) -> Organization:

elif self.kwargs.get('pk', None):

self._obj_organization = self.get_object().organization

obj = self.model.objects.get( pk = self.kwargs.get('pk', None) )

if getattr(obj, 'organization', None):

self._obj_organization = obj.organization

elif str(self.model._meta.verbose_name).lower() == 'organization':

self._obj_organization = obj


if self.get_parent_model(): # if defined is to overwrite object organization
Expand Down

0 comments on commit a4788ab

Please sign in to comment.