fix: icon_key 无效时回传具体 key,并提示需更新接单池背景相关版本
便于定位是空 key 还是服务器未 pull/未重启导致 grab_card_* 未注册。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -98,9 +98,20 @@ class ClubMiniappIconManageView(APIView):
|
|||||||
|
|
||||||
action = (request.data.get('action') or 'upload').strip()
|
action = (request.data.get('action') or 'upload').strip()
|
||||||
club_id = resolve_effective_club_id(request, request.user)
|
club_id = resolve_effective_club_id(request, request.user)
|
||||||
icon_key = (request.data.get('icon_key') or '').strip()
|
raw_key = request.data.get('icon_key')
|
||||||
|
if raw_key is None or raw_key == '':
|
||||||
|
raw_key = request.query_params.get('icon_key')
|
||||||
|
if isinstance(raw_key, (list, tuple)):
|
||||||
|
raw_key = raw_key[0] if raw_key else ''
|
||||||
|
icon_key = str(raw_key or '').strip()
|
||||||
if icon_key not in MINIAPP_ICON_LABELS:
|
if icon_key not in MINIAPP_ICON_LABELS:
|
||||||
return Response({'code': 400, 'msg': 'icon_key 无效'})
|
return Response({
|
||||||
|
'code': 400,
|
||||||
|
'msg': (
|
||||||
|
f'icon_key 无效: {icon_key or "(空)"}。'
|
||||||
|
'若上传接单池卡背景,请确认 Django 已 pull 到含 grab_card_* 的提交并重启进程'
|
||||||
|
),
|
||||||
|
})
|
||||||
|
|
||||||
if action == 'save_meta':
|
if action == 'save_meta':
|
||||||
description = (request.data.get('description') or '').strip()
|
description = (request.data.get('description') or '').strip()
|
||||||
|
|||||||
Reference in New Issue
Block a user