peng пре 1 година
родитељ
комит
3d98378d42
1 измењених фајлова са 7 додато и 5 уклоњено
  1. 7 5
      AdminController/EvaluationActivityController.py

+ 7 - 5
AdminController/EvaluationActivityController.py

@@ -189,12 +189,14 @@ class EvaluationActivityView(View):
                 else:  # 增加活动
                     if not all([carousel_image, details_image]):
                         return response.json(404)
-                    FreeEvaluationActivity.objects.create(activity_name=activity_name, product_number=product_number,
-                                                          carousel_image_url=carousel_image_url, is_show=is_show,
-                                                          original_price=original_price,
-                                                          details_image_url=details_image_url, issue=issue)
+                    activity_qs = FreeEvaluationActivity.objects.create(activity_name=activity_name,
+                                                                        product_number=product_number,
+                                                                        carousel_image_url=carousel_image_url,
+                                                                        is_show=is_show, issue=issue,
+                                                                        original_price=original_price,
+                                                                        details_image_url=details_image_url)
                     for index, item in enumerate(activity_process):
-                        ActivityTime.objects.create(activity_id=activity_id, node_content=item['node_content'],
+                        ActivityTime.objects.create(activity_id=activity_qs.id, node_content=item['node_content'],
                                                     start_time=item['start_time'], end_time=item['end_time'],
                                                     sort=index)
             return response.json(0)