diff --git a/app/models/user.py b/app/models/user.py index 0d4144898..aed7feacc 100644 --- a/app/models/user.py +++ b/app/models/user.py @@ -146,14 +146,14 @@ def validate_inbounds(cls, inbounds, values, **kwargs): for proxy_type in proxies: tags = inbounds.get(proxy_type) - if isinstance(tags, list) and not tags: - raise ValueError(f"{proxy_type} inbounds cannot be empty") - - elif tags: + if tags: for tag in tags: if tag not in xray.config.inbounds_by_tag: raise ValueError(f"Inbound {tag} doesn't exist") + # elif isinstance(tags, list) and not tags: + # raise ValueError(f"{proxy_type} inbounds cannot be empty") + else: inbounds[proxy_type] = [ i["tag"] @@ -222,8 +222,9 @@ def validate_inbounds(cls, inbounds, values, **kwargs): # so inbounds particularly can be modified if inbounds: for proxy_type, tags in inbounds.items(): - if not tags: - raise ValueError(f"{proxy_type} inbounds cannot be empty") + + # if not tags: + # raise ValueError(f"{proxy_type} inbounds cannot be empty") for tag in tags: if tag not in xray.config.inbounds_by_tag: