haha
This commit is contained in:
@@ -65,7 +65,13 @@ def task_list(request):
|
||||
ser.is_valid(raise_exception=True)
|
||||
|
||||
validated = ser.validated_data.copy()
|
||||
account_id = validated.pop("id", None)
|
||||
account_id = validated.pop("id", None) or validated.pop("account_id", None)
|
||||
# form-data 可能把数字传成字符串
|
||||
if account_id is not None:
|
||||
try:
|
||||
account_id = int(account_id)
|
||||
except (TypeError, ValueError):
|
||||
account_id = None
|
||||
req = TaskCreate(**validated)
|
||||
target_worker_id = req.worker_id or ""
|
||||
account_name = req.account_name or ""
|
||||
|
||||
Reference in New Issue
Block a user