mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-08 00:28:16 -06:00
Cleaner type check
This commit is contained in:
parent
05bcfd7722
commit
8f5162ed02
@ -97,7 +97,7 @@ def qs_filter_from_constraints(constraints, tokens=None):
|
|||||||
if type(value) is list:
|
if type(value) is list:
|
||||||
return list(map(lambda v: tokens.get(v, v), value))
|
return list(map(lambda v: tokens.get(v, v), value))
|
||||||
User = apps.get_model('users.User')
|
User = apps.get_model('users.User')
|
||||||
if value == CONSTRAINT_TOKEN_USER and type(tokens[CONSTRAINT_TOKEN_USER] is User):
|
if value == CONSTRAINT_TOKEN_USER and isinstance(tokens.get(CONSTRAINT_TOKEN_USER), User):
|
||||||
return tokens[CONSTRAINT_TOKEN_USER].id
|
return tokens[CONSTRAINT_TOKEN_USER].id
|
||||||
return tokens.get(value, value)
|
return tokens.get(value, value)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user