Просмотр исходного кода

Fixes #20585: Fix AttributeError exception for conditionless single-field UniqueConstraints (#20590)

Jeremy Stretch 4 месяцев назад
Родитель
Сommit
c902a1c510
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      netbox/netbox/monkey.py

+ 1 - 1
netbox/netbox/monkey.py

@@ -22,7 +22,7 @@ def get_unique_validators(field_name, model_field):
     # START custom logic
     conditions = {
         cond for cond in conditions
-        if cond.referenced_base_fields == field_set
+        if cond is None or cond.referenced_base_fields == field_set
     }
     # END custom logic