Fix server error assigning teams EE object roles (#15320)

This commit is contained in:
Alan Rominger
2024-07-03 14:07:03 -04:00
committed by GitHub
parent 94e5795dfc
commit d91af132c1
2 changed files with 22 additions and 2 deletions

View File

@@ -68,5 +68,5 @@ class ExecutionEnvironment(CommonModel):
raise ValidationError({'user': _('User must have view permission to Execution Environment organization')})
if actor._meta.model_name == 'team':
organization_cls = self._meta.get_field('organization').related_model
if self.orgaanization not in organization_cls.access_qs(actor, 'view'):
if self.organization not in organization_cls.access_qs(actor, 'view'):
raise ValidationError({'team': _('Team must have view permission to Execution Environment organization')})