We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7cc4bca commit 9337adeCopy full SHA for 9337ade
djangosaml2/backends.py
@@ -50,14 +50,14 @@ def get_django_user_lookup_attribute(userModel) -> str:
50
return getattr(userModel, 'USERNAME_FIELD', 'username')
51
52
53
-def set_attribute(obj, attr, value) -> bool:
+def set_attribute(obj, attr, new_value) -> bool:
54
""" Set an attribute of an object to a specific value, if it wasn't that already.
55
Return True if the attribute was changed and False otherwise.
56
"""
57
58
old_value = getattr(obj, attr)
59
- if cleaned_value != old_value:
60
- setattr(obj, attr, cleaned_value)
+ if new_value != old_value:
+ setattr(obj, attr, new_value)
61
return True
62
63
return False
0 commit comments