Fix Bug: ProductBrandStatusCode.BRAND_NOT_FOUND

Brightcells 7 年 前
コミット
f0ea40faf6
共有1 個のファイルを変更した8 個の追加1 個の削除を含む
  1. 8 1
      page/sale_views.py

+ 8 - 1
page/sale_views.py

@@ -218,7 +218,14 @@ def clerk_integral_list_api(request):
218 218
         return response(SaleclerkStatusCode.CLERK_NOT_FOUND)
219 219
 
220 220
     try:
221
-        clerk = SaleclerkInfo.objects.get(brand_id=brandID, unionid=user.unionid, status=True)
221
+        brand = BrandInfo.objects.get(pk=brandID)
222
+    except BrandInfo.DoesNotExist:
223
+        return response(ProductBrandStatusCode.BRAND_NOT_FOUND)
224
+    except ValueError:
225
+        return response(ProductBrandStatusCode.BRAND_NOT_FOUND)
226
+
227
+    try:
228
+        clerk = SaleclerkInfo.objects.get(brand_id=brand.brand_id, unionid=user.unionid, status=True)
222 229
     except SaleclerkInfo.DoesNotExist:
223 230
         return response(SaleclerkStatusCode.CLERK_NOT_FOUND)
224 231