fix(access): add property organization to Tenant model
required so that perms work ref: #805 #790
This commit is contained in:
@ -16,6 +16,10 @@ class Tenant(
|
||||
Centurion,
|
||||
):
|
||||
|
||||
@property
|
||||
def organization(self):
|
||||
return self
|
||||
|
||||
model_tag = 'tenant'
|
||||
|
||||
class Meta:
|
||||
|
@ -68,7 +68,7 @@ class TenantModelSerializer(
|
||||
# 'model_id': item.pk
|
||||
# }
|
||||
# ),
|
||||
'teams': reverse("v2:_api_tenant_team-list", request=self._context['view'].request, kwargs={'organization_id': item.pk}),
|
||||
'teams': reverse("v2:_api_v2_organization_team-list", request=self._context['view'].request, kwargs={'organization_id': item.pk}),
|
||||
}
|
||||
|
||||
model_notes = centurion_field.MarkdownField( required = False )
|
||||
|
@ -182,7 +182,8 @@ class MetaAbstractModelInheritedCases(
|
||||
|
||||
instance = note_model()
|
||||
instance.id = 1
|
||||
instance.organization = organization_one
|
||||
if type(note_model.organization) is not property:
|
||||
instance.organization = organization_one
|
||||
|
||||
model_instance.id = 1
|
||||
model_instance.model = instance
|
||||
|
Reference in New Issue
Block a user