move inside if block

This commit is contained in:
wh1te909
2024-10-29 20:03:10 +00:00
parent 18b1afe34f
commit 8d543dcc7d

View File

@@ -131,15 +131,13 @@ class CoreSettings(BaseAuditModel):
old_settings = type(self).objects.get(pk=self.pk) if self.pk else None
print(old_settings.__dict__)
# fail safe to not lock out user logons
if not old_settings.sso_enabled and old_settings.block_local_user_logon:
self.block_local_user_logon = False
print("I'm Here!")
super().save(*args, **kwargs)
if old_settings:
# fail safe to not lock out user logons
if not old_settings.sso_enabled and old_settings.block_local_user_logon:
self.block_local_user_logon = False
if (
old_settings.alert_template != self.alert_template
or old_settings.server_policy != self.server_policy