auth: Remove redundant call to pad_method_dict().

This was called in both if and else with the same argument.
I believe there's no reason for it to exist twice and having
it just once would be a bit cleaner.
This commit is contained in:
Dinesh 2020-09-17 17:23:21 +00:00 committed by Tim Abbott
parent 144296f9c0
commit 1dc44703f1
1 changed files with 2 additions and 2 deletions

View File

@ -110,10 +110,10 @@ def pad_method_dict(method_dict: Dict[str, bool]) -> Dict[str, bool]:
def auth_enabled_helper(backends_to_check: List[str], realm: Optional[Realm]) -> bool:
if realm is not None:
enabled_method_dict = realm.authentication_methods_dict()
pad_method_dict(enabled_method_dict)
else:
enabled_method_dict = {method: True for method in Realm.AUTHENTICATION_FLAGS}
pad_method_dict(enabled_method_dict)
pad_method_dict(enabled_method_dict)
for supported_backend in supported_auth_backends():
for backend_name in backends_to_check:
backend = AUTH_BACKEND_NAME_MAP[backend_name]