mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
custom_profile_fields: Restrict access to users in the same realm.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
85abd9d58b
commit
87e4b99706
@@ -526,7 +526,7 @@ def validate_user_custom_profile_data(
|
||||
for item in profile_data:
|
||||
field_id = item["id"]
|
||||
try:
|
||||
field = CustomProfileField.objects.get(id=field_id)
|
||||
field = CustomProfileField.objects.get(realm_id=realm_id, id=field_id)
|
||||
except CustomProfileField.DoesNotExist:
|
||||
raise JsonableError(_("Field id {id} not found.").format(id=field_id))
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ def delete_realm_custom_profile_field(
|
||||
request: HttpRequest, user_profile: UserProfile, field_id: int
|
||||
) -> HttpResponse:
|
||||
try:
|
||||
field = CustomProfileField.objects.get(id=field_id)
|
||||
field = CustomProfileField.objects.get(realm_id=user_profile.realm_id, id=field_id)
|
||||
except CustomProfileField.DoesNotExist:
|
||||
raise JsonableError(_("Field id {id} not found.").format(id=field_id))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user