Răsfoiți Sursa

Closes #21875: Allow subclasses of dict for API_TOKEN_PEPPERS

Sergio López 2 luni în urmă
părinte
comite
660ca42149
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      netbox/utilities/security.py

+ 1 - 1
netbox/utilities/security.py

@@ -9,7 +9,7 @@ def validate_peppers(peppers):
     """
     Validate the given dictionary of cryptographic peppers for type & sufficient length.
     """
-    if type(peppers) is not dict:
+    if not isinstance(peppers, dict):
         raise ImproperlyConfigured("API_TOKEN_PEPPERS must be a dictionary.")
     for key, pepper in peppers.items():
         if type(key) is not int: