feat: 俱乐部可关闭强制收集手机号(yhbdsjh 返回无需认证)
This commit is contained in:
@@ -632,6 +632,7 @@ class ClubManageView(APIView):
|
||||
|
||||
def _serialize(self, club, full=False):
|
||||
from jituan.services.default_invite import get_club_default_dashou_invite
|
||||
from jituan.services.force_phone_auth import is_club_force_phone_auth
|
||||
|
||||
cfg_json = club.config_json or {}
|
||||
base = {
|
||||
@@ -649,6 +650,7 @@ class ClubManageView(APIView):
|
||||
'template_id': club.template_id,
|
||||
'sort_order': club.sort_order,
|
||||
'default_dashou_invite': get_club_default_dashou_invite(club.club_id),
|
||||
'force_phone_auth': is_club_force_phone_auth(club.club_id),
|
||||
}
|
||||
if full:
|
||||
mch_key = self._effective_mch_key(club)
|
||||
@@ -724,6 +726,16 @@ class ClubManageView(APIView):
|
||||
set_club_default_dashou_invite(club, request.data.get('default_dashou_invite'))
|
||||
if 'config_json' not in update_fields:
|
||||
update_fields.append('config_json')
|
||||
if 'force_phone_auth' in request.data:
|
||||
from jituan.services.force_phone_auth import set_club_force_phone_auth
|
||||
raw = request.data.get('force_phone_auth')
|
||||
if isinstance(raw, str):
|
||||
enabled = raw.strip().lower() in ('1', 'true', 'yes', 'on')
|
||||
else:
|
||||
enabled = bool(raw)
|
||||
set_club_force_phone_auth(club, enabled)
|
||||
if 'config_json' not in update_fields:
|
||||
update_fields.append('config_json')
|
||||
if update_fields:
|
||||
club.save(update_fields=update_fields)
|
||||
return Response({
|
||||
|
||||
Reference in New Issue
Block a user