mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-22 13:59:51 +03:00
Update decorators.py
This commit is contained in:
parent
14d6941390
commit
30ba7bee0d
|
@ -15,7 +15,7 @@ def either(expected):
|
||||||
if not any(arg_list):
|
if not any(arg_list):
|
||||||
raise TooFewArgs("Too few arguments, must be either of: " + ",".join(expected))
|
raise TooFewArgs("Too few arguments, must be either of: " + ",".join(expected))
|
||||||
|
|
||||||
if all(arg_list) or arg_list.count(True) > 1:
|
if arg_list.count(True) > 1:
|
||||||
raise TooManyArgs("Too many arguments, must be either of: " + ",".join(expected))
|
raise TooManyArgs("Too many arguments, must be either of: " + ",".join(expected))
|
||||||
|
|
||||||
return func(*args, **kwargs)
|
return func(*args, **kwargs)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user