mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-07 16:18: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:
|
||||
return list(map(lambda v: tokens.get(v, v), value))
|
||||
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.get(value, value)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user