apf
(Andreas)
1월 15, 2026, 6:19오후
1
우선순위/심각도 :
중간에서 높음
플랫폼:
Python 스크립트 및 cURL 명령줄
Discourse 서버 버전:
3.6.0.beta3-latest (6adb4f8e84 )
설명 :
기존 그룹의 ‘watching_category_ids’를 업데이트하려고 할 때, 내 Python 스크립트(단순한 “requests.put” 사용)가 다음 오류를 보고합니다:
_doPut> ERROR from request: 422 Unprocessable Entity {‘user_count’: 2, ‘errors’: [‘You supplied invalid parameters to the request: update_existing_users’]}
JSON 데이터에 update_existing_users라는 이름의 매개변수가 없는데도요.
cURL을 사용하여 다음을 확인해 보았습니다:
curl -k -L -X PUT -H 'api-key:xyz’ \
-H 'api-username:system' \
-H 'Accept:application/json;charset=utf-8' \
-H 'Content-Type:application/json' \
--data '{"group":{"name":"eb-chair-exo","watching_category_ids":[336,337]}}' \
https://cms-phys-talk.web.cern.ch/groups/46.json
같은 오류가 발생합니다:
{“user_count”:2,“errors”:[“You supplied invalid parameters to the request: update_existing_users”]}%
재현 단계 :
curl -k -L -X PUT -H 'api-key:xyz’ \
-H 'api-username:system' \
-H 'Accept:application/json;charset=utf-8' \
-H 'Content-Type:application/json' \
--data '{"group":{"name":"eb-chair-exo","watching_category_ids":[336,337]}}' \
https://cms-phys-talk.web.cern.ch/groups/46.json
수정: discourse 서버 버전 추가
네, 그 엔드포인트가 좀 특이합니다. 잠재적으로 영향을 받을 수 있는 사용자 수에 대해 직원들에게 경고하고, 변경 사항을 소급 적용할지 여부를 선택할 수 있도록 하고 싶었거든요.
그래서 서버 응답에서 "{ 'user_count': 2, ... }"를 확인하실 수 있습니다.
오류 메시지를 더 명확하게 수정했고, 이 "사용 사례"를 더 잘 처리하도록 프론트엔드 코드도 개선했으며, 스펙도 추가했습니다.
main ← fix-group-update-existing-users-error
merged 04:08AM - 19 Jan 26 UTC
When updating a group's notification defaults (like watching_category_ids) via A… PI, if existing members would be affected, the server returns a 422 asking the caller to specify whether to apply changes to existing users.
The previous error message was confusing: "You supplied invalid parameters to the request: update_existing_users" - even though the caller hadn't supplied that parameter at all. The new message clearly explains what's happening and what to do:
"This change affects X existing group members. You must specify the 'update_existing_users' parameter (true or false) to indicate whether to apply the new notification defaults to existing members."
Also fixed a bug where the confirmation modal state wasn't being reset when navigating between groups, causing the modal to not appear on subsequent group edits. The modal now returns its result directly instead of storing it in component state.
Ref - https://meta.discourse.org/t/-/393572
1개의 좋아요
apf
(Andreas)
1월 16, 2026, 6:51오후
4
안녕하세요 - 빠른 조치에 감사합니다!
불행히도 여전히 혼란스럽습니다. 특정 그룹에 대해 watching_category_ids 값을 설정해야 하는데, 오류 메시지가 변경되었음에도 불구하고 여전히 422 오류가 발생합니다. 그렇다면 rest-API를 사용하여 스크립트로 watching_category_ids의 새 목록으로 그룹을 업데이트하는 방법은 무엇일까요?
이미 PUT 호출의 JSON 데이터에 "update_existing_users"=True를 추가해 보았지만, 보고된 것과 동일한 오류가 발생했습니다.
다시 한번 감사합니다.
감사합니다, Andreas
apf
(Andreas)
1월 17, 2026, 7:43오전
6
정말 감사합니다, @zogstrip ! 이제 잘 작동합니다!
(참고로, "update_existing_users”=True는 JSON 전송 시 “group” 항목과 나란히(외부에) 위치해야 합니다. 여기서는 Python 문법으로 표시되어 있으므로, True가 문자열 “true”로 변환됩니다):
jsonData={
"group": {
"name": f"{groupName}",
"watching_category_ids": newWatchList,
},
"update_existing_users": True,
},
sam
(Sam Saffron)
에 닫힘
1월 19, 2026, 9:00오후
8
이 주제는 20시간 후 자동으로 닫혔습니다. 더 이상 답변을 남길 수 없습니다.