Kaydet (Commit) b728ab22 authored tarafından Sergey Fedoseev's avatar Sergey Fedoseev

Simplified BaseModelAdmin.lookup_allowed() a bit.

üst 85e6a1c6
......@@ -364,9 +364,8 @@ class BaseModelAdmin(metaclass=forms.MediaDefiningClass):
# As ``limit_choices_to`` can be a callable, invoke it here.
if callable(fk_lookup):
fk_lookup = fk_lookup()
for k, v in widgets.url_params_from_lookup_dict(fk_lookup).items():
if k == lookup and v == value:
return True
if (lookup, value) in widgets.url_params_from_lookup_dict(fk_lookup).items():
return True
relation_parts = []
prev_field = None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment