Skip to content

Commit 9d8eb8e

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 4e9710b commit 9d8eb8e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

api/segments/serializers.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,12 @@ class Meta:
116116

117117
def validate(self, attrs: dict[str, Any]) -> dict[str, Any]:
118118
attrs = super().validate(attrs)
119-
project = self.instance.project if self.instance else Project.objects.get(
120-
pk=int(self.context["view"].kwargs["project_pk"]),
119+
project = (
120+
self.instance.project
121+
if self.instance
122+
else Project.objects.get(
123+
pk=int(self.context["view"].kwargs["project_pk"]),
124+
)
121125
)
122126
organisation = project.organisation
123127

0 commit comments

Comments
 (0)