Skip to content

Commit

Permalink
sigh
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
  • Loading branch information
BeryJu committed Jun 18, 2024
1 parent 5213310 commit 6f086b1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion authentik/core/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ def update(self, instance: Model, validated_data):
# updated instance and we do not want it to collide with .update()
for attr, value in m2m_fields:
field = getattr(instance, attr)
field.set(value, bulk=False)
# We can't check for inheritance here as m2m managers are generated dynamically
if field.__class__.__name__ == "RelatedManager":
field.set(value, bulk=False)

Check warning on line 57 in authentik/core/api/utils.py

View check run for this annotation

Codecov / codecov/patch

authentik/core/api/utils.py#L57

Added line #L57 was not covered by tests
else:
field.set(value)

return instance

Expand Down

0 comments on commit 6f086b1

Please sign in to comment.