add allowed_networks to ADMIN_ONLY_PROPS

This commit is contained in:
Seth Van Niekerk 2026-05-01 09:14:30 -04:00
parent a01814069a
commit 911644531b
No known key found for this signature in database
GPG key ID: E86ACA677312A675

View file

@ -252,8 +252,8 @@ class UserViewSet(viewsets.ModelViewSet):
request.data.pop(key, None)
# Strip admin-managed keys from custom_properties so users cannot
# set their own XC credentials via this endpoint.
ADMIN_ONLY_PROPS = {"xc_password"}
# set their own XC credentials or network rules via this endpoint.
ADMIN_ONLY_PROPS = {"xc_password", "allowed_networks"}
cp = request.data.get("custom_properties")
if isinstance(cp, dict):
for key in ADMIN_ONLY_PROPS: