fix - quota list by is_closed
This commit is contained in:
@@ -418,7 +418,7 @@ class Quota(BaseModel):
|
||||
if last:
|
||||
next_code = last.quota_id + 1
|
||||
else:
|
||||
next_code = 1001
|
||||
next_code = 10001
|
||||
return next_code
|
||||
|
||||
def calculate_final_price(self):
|
||||
|
||||
@@ -347,7 +347,8 @@ class QuotaViewSet(BaseViewSet, SoftDeleteMixin, viewsets.ModelViewSet, DynamicS
|
||||
""" list of organization active quotas """
|
||||
|
||||
queryset = self.filter_query(
|
||||
self.get_queryset(visibility_by_org_scope=True)) # return by search param or all objects
|
||||
self.get_queryset(visibility_by_org_scope=True).filter(
|
||||
is_closed=False)) # return by search param or all objects
|
||||
|
||||
# paginate queryset
|
||||
page = self.paginate_queryset(
|
||||
@@ -369,7 +370,8 @@ class QuotaViewSet(BaseViewSet, SoftDeleteMixin, viewsets.ModelViewSet, DynamicS
|
||||
""" list of organization closed quotas """
|
||||
|
||||
queryset = self.filter_query(
|
||||
self.get_queryset(visibility_by_org_scope=True)) # return by search param or all objects
|
||||
self.get_queryset(visibility_by_org_scope=True).filter(
|
||||
is_closed=True)) # return by search param or all objects
|
||||
|
||||
# paginate queryset
|
||||
page = self.paginate_queryset(
|
||||
|
||||
@@ -664,3 +664,7 @@ AssertionError: .validate() should return the validated data
|
||||
[2025-11-02 11:04:48,112] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader
|
||||
[2025-11-02 11:05:16,197] INFO django.server | IP: - | Path: - | "GET /auth/api/v1/organization/child_organizations/ HTTP/1.1" 200 6938
|
||||
[2025-11-02 11:33:14,043] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\product\models.py changed, reloading.
|
||||
[2025-11-02 11:33:18,814] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader
|
||||
[2025-11-02 11:35:44,882] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\product\models.py changed, reloading.
|
||||
[2025-11-02 11:35:52,593] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader
|
||||
[2025-11-02 11:36:51,561] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\product\web\api\v1\viewsets\quota_api.py changed, reloading.
|
||||
|
||||
Reference in New Issue
Block a user