diff --git a/.env.local b/.env.local index 2028adf..681373d 100644 --- a/.env.local +++ b/.env.local @@ -7,7 +7,7 @@ ENV_NAME=DEV # Database secrets DB_HOST=31.7.78.133 DB_PORT=14352 -DB_NAME=Development +DB_NAME=Production DB_USERNAME=postgres DB_PASSWORD=pfLIVXupbDetvFMt2gUvxLXUL9b4HIOHaPcKXsBEZ1i8zl0iLUjmhUfXlGfJKcTV diff --git a/apps/pos_device/services/services.py b/apps/pos_device/services/services.py index 7976fa5..8a2fc37 100644 --- a/apps/pos_device/services/services.py +++ b/apps/pos_device/services/services.py @@ -44,9 +44,30 @@ def pos_organizations_sharing_information( "agency": False, "default_account": item.default }) + else: + sharing_information_list.append({ + "organization_name": "تعاونی دامداران فامنین", + "bank_account": { + "credit_card": "2222222222222222", + "sheba": "666666666666666666", + "account": "4444444444444444444444", + }, + "broker": "تعاونی", + "amount": 1600, + + # """ + # if we will need to get agencies share amount, we can use this bellow code + # + # # item.holders_share_amount.filter(quota_distribution=distribution).first().share_amount + # # if item.holders_share_amount.filter(quota_distribution=distribution).exists() else None + # """ + "agency": False, + "default_account": True + }) # if device owner is an agency organization - if owner_org.type.name == 'AGC': + print(sharing_information_list) + if owner_org.type.key == 'AGC': sharing_information_list = agency_organization_pos_info( agency=owner_org, pos_sharing_list=sharing_information_list, @@ -74,6 +95,7 @@ def agency_organization_pos_info( ).first().holders_share_amount.filter( quota_distribution=distribution ) + agc_share_amount = agc_share_amount.first().share_amount if agc_share_amount else None # calculate agency parent share amount diff --git a/apps/product/pos/api/v1/viewsets/quota_distribution_api.py b/apps/product/pos/api/v1/viewsets/quota_distribution_api.py index fcd8f98..69f730f 100644 --- a/apps/product/pos/api/v1/viewsets/quota_distribution_api.py +++ b/apps/product/pos/api/v1/viewsets/quota_distribution_api.py @@ -1,19 +1,18 @@ -from apps.product.pos.api.v1.serializers import quota_distribution_serializers as distribution_serializers -from apps.pos_device.mixins.pos_device_mixin import POSDeviceMixin -from apps.core.mixins.search_mixin import DynamicSearchMixin -from apps.core.pagination import CustomPageNumberPagination -from apps.warehouse.services.services import can_buy_from_inventory -from common.helpers import get_organization_by_user +from django.db import transaction +from rest_framework import status +from rest_framework import viewsets +from rest_framework.decorators import action from rest_framework.exceptions import APIException -from apps.product import models as product_models from rest_framework.permissions import AllowAny from rest_framework.response import Response -from rest_framework.decorators import action -from rest_framework import viewsets, filters + +from apps.core.mixins.search_mixin import DynamicSearchMixin +from apps.core.pagination import CustomPageNumberPagination from apps.herd.models import Rancher -from rest_framework import status -from django.db import transaction -from django.db.models import Q +from apps.pos_device.mixins.pos_device_mixin import POSDeviceMixin +from apps.product import models as product_models +from apps.product.pos.api.v1.serializers import quota_distribution_serializers as distribution_serializers +from apps.warehouse.services.services import can_buy_from_inventory def trash(queryset, pk): # noqa @@ -102,6 +101,7 @@ class QuotaDistributionViewSet(viewsets.ModelViewSet, DynamicSearchMixin, POSDev can_buy_from_inventory(rancher.first(), distribution=distribution) & rancher.exists() ) ] + print(device) # paginate & response page = self.paginate_queryset(available_distributions) # noqa diff --git a/logs/django_requests.log b/logs/django_requests.log index 9e221d0..b703b0e 100644 --- a/logs/django_requests.log +++ b/logs/django_requests.log @@ -1275,3 +1275,608 @@ TypeError: 'NoneType' object is not iterable [2025-11-04 14:48:29,357] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\product\web\api\v1\serializers\quota_distribution_serializers.py changed, reloading. [2025-11-04 14:48:32,974] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader [2025-11-04 14:48:39,380] INFO django.server | IP: - | Path: - | "POST /pos_device/web/v1/pos/holders_share/ HTTP/1.1" 201 6444 +[2025-11-04 14:52:02,705] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 14:52:02,955] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 14:53:58,799] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 14:53:59,056] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 16:13:12,819] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:13:13,074] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 16:24:38,776] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:24:39,045] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 16:27:00,286] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:27:00,496] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 16:27:07,603] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4061080598 HTTP/1.1" 301 0 +[2025-11-04 16:27:07,844] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4061080598 HTTP/1.1" 200 135 +[2025-11-04 16:28:35,532] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:28:35,773] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 16:31:50,747] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:31:51,039] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 16:31:53,034] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:31:53,315] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 16:33:07,066] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py changed, reloading. +[2025-11-04 16:33:11,427] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 16:33:16,056] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:33:16,315] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 16:33:26,201] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py changed, reloading. +[2025-11-04 16:33:28,563] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 16:33:33,531] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:33:33,752] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 16:33:36,279] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:33:36,545] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 16:33:46,508] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py changed, reloading. +[2025-11-04 16:33:49,342] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 16:33:55,737] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:33:55,976] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 16:33:58,915] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:33:59,161] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 16:37:38,288] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py changed, reloading. +[2025-11-04 16:37:40,860] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 16:39:03,447] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:39:03,697] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 16:39:11,646] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py changed, reloading. +[2025-11-04 16:39:14,989] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 16:39:19,119] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:39:19,402] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 16:39:35,211] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py changed, reloading. +[2025-11-04 16:39:37,974] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 16:39:42,776] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:39:44,415] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 13860 +[2025-11-04 16:39:54,036] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py changed, reloading. +[2025-11-04 16:39:56,890] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 16:40:01,717] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:40:03,247] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 13860 +[2025-11-04 16:44:24,477] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py changed, reloading. +[2025-11-04 16:44:26,557] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 16:44:30,851] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:44:31,111] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 16:51:33,508] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:51:33,797] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 16:51:35,615] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:51:35,837] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 16:57:05,241] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:57:05,970] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 16:57:34,372] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:57:56,151] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:58:38,351] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 16:59:12,453] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:05:47,947] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 17:05:52,847] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:05:53,557] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 17:05:56,102] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:05:56,332] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 135 +[2025-11-04 17:06:17,529] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 17:06:22,919] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:06:23,834] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 2942 +[2025-11-04 17:07:06,225] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\pos_device\services\services.py changed, reloading. +[2025-11-04 17:07:10,761] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 17:07:15,282] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:07:15,776] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 2942 +[2025-11-04 17:07:20,401] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:07:20,939] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 2942 +[2025-11-04 17:08:29,872] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:08:30,367] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 2942 +[2025-11-04 17:08:56,226] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\pos_device\services\services.py changed, reloading. +[2025-11-04 17:08:58,633] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 17:09:04,507] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:09:05,037] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 2942 +[2025-11-04 17:09:14,754] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\pos_device\services\services.py changed, reloading. +[2025-11-04 17:09:19,523] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 17:09:23,486] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:09:24,021] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 2942 +[2025-11-04 17:09:29,099] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:09:29,638] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 2942 +[2025-11-04 17:09:42,069] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\pos_device\services\services.py changed, reloading. +[2025-11-04 17:09:47,019] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 17:09:51,187] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:09:51,678] ERROR django.request | IP: 127.0.0.1 | Path: /product/pos/api/v1/distributions/rancher_distributions/ | Internal Server Error: /product/pos/api/v1/distributions/rancher_distributions/ +Traceback (most recent call last): + File "D:\Software\env\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\views\decorators\csrf.py", line 65, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\viewsets.py", line 125, in view + return self.dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 515, in dispatch + response = self.handle_exception(exc) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 472, in handle_exception + response = exception_handler(exc, context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 512, in dispatch + response = handler(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py", line 119, in rancher_distributions + return self.get_paginated_response(serializer.data) + ^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 797, in data + ret = super().data + ^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 251, in data + self._data = self.to_representation(self.instance) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 716, in to_representation + self.child.to_representation(item) for item in iterable + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\serializers\quota_distribution_serializers.py", line 124, in to_representation + 'base_prices': quota_pricing_items_by_type(instance.quota, sharing=sharing_list) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\services\services.py", line 107, in quota_pricing_items_by_type + calculate_sharing_total_price = sum(item['amount'] for item in sharing if item['amount'] is not None) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: 'NoneType' object is not iterable +[2025-11-04 17:09:51,684] ERROR django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 500 149470 +[2025-11-04 17:11:10,725] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\pos_device\services\services.py changed, reloading. +[2025-11-04 17:11:12,729] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 17:12:55,374] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\pos_device\services\services.py changed, reloading. +[2025-11-04 17:12:57,556] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 17:13:08,433] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:13:08,947] ERROR django.request | IP: 127.0.0.1 | Path: /product/pos/api/v1/distributions/rancher_distributions/ | Internal Server Error: /product/pos/api/v1/distributions/rancher_distributions/ +Traceback (most recent call last): + File "D:\Software\env\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\views\decorators\csrf.py", line 65, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\viewsets.py", line 125, in view + return self.dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 515, in dispatch + response = self.handle_exception(exc) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 472, in handle_exception + response = exception_handler(exc, context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 512, in dispatch + response = handler(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py", line 119, in rancher_distributions + return self.get_paginated_response(serializer.data) + ^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 797, in data + ret = super().data + ^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 251, in data + self._data = self.to_representation(self.instance) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 716, in to_representation + self.child.to_representation(item) for item in iterable + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\serializers\quota_distribution_serializers.py", line 124, in to_representation + 'base_prices': quota_pricing_items_by_type(instance.quota, sharing=sharing_list) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\services\services.py", line 107, in quota_pricing_items_by_type + calculate_sharing_total_price = sum(item['amount'] for item in sharing if item['amount'] is not None) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: 'NoneType' object is not iterable +[2025-11-04 17:13:08,953] ERROR django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 500 149470 +[2025-11-04 17:13:29,546] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\pos_device\services\services.py changed, reloading. +[2025-11-04 17:13:31,752] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 17:13:38,306] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:13:38,753] ERROR django.request | IP: 127.0.0.1 | Path: /product/pos/api/v1/distributions/rancher_distributions/ | Internal Server Error: /product/pos/api/v1/distributions/rancher_distributions/ +Traceback (most recent call last): + File "D:\Software\env\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\views\decorators\csrf.py", line 65, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\viewsets.py", line 125, in view + return self.dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 515, in dispatch + response = self.handle_exception(exc) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 472, in handle_exception + response = exception_handler(exc, context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 512, in dispatch + response = handler(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py", line 119, in rancher_distributions + return self.get_paginated_response(serializer.data) + ^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 797, in data + ret = super().data + ^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 251, in data + self._data = self.to_representation(self.instance) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 716, in to_representation + self.child.to_representation(item) for item in iterable + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\serializers\quota_distribution_serializers.py", line 124, in to_representation + 'base_prices': quota_pricing_items_by_type(instance.quota, sharing=sharing_list) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\services\services.py", line 107, in quota_pricing_items_by_type + calculate_sharing_total_price = sum(item['amount'] for item in sharing if item['amount'] is not None) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: 'NoneType' object is not iterable +[2025-11-04 17:13:38,757] ERROR django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 500 149470 +[2025-11-04 17:20:42,570] INFO django.server | IP: - | Path: - | "POST /pos_device/web/v1/pos/holders_share/ HTTP/1.1" 201 5912 +[2025-11-04 17:20:47,251] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:20:47,751] ERROR django.request | IP: 127.0.0.1 | Path: /product/pos/api/v1/distributions/rancher_distributions/ | Internal Server Error: /product/pos/api/v1/distributions/rancher_distributions/ +Traceback (most recent call last): + File "D:\Software\env\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\views\decorators\csrf.py", line 65, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\viewsets.py", line 125, in view + return self.dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 515, in dispatch + response = self.handle_exception(exc) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 472, in handle_exception + response = exception_handler(exc, context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 512, in dispatch + response = handler(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py", line 119, in rancher_distributions + return self.get_paginated_response(serializer.data) + ^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 797, in data + ret = super().data + ^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 251, in data + self._data = self.to_representation(self.instance) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 716, in to_representation + self.child.to_representation(item) for item in iterable + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\serializers\quota_distribution_serializers.py", line 124, in to_representation + 'base_prices': quota_pricing_items_by_type(instance.quota, sharing=sharing_list) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\services\services.py", line 107, in quota_pricing_items_by_type + calculate_sharing_total_price = sum(item['amount'] for item in sharing if item['amount'] is not None) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: 'NoneType' object is not iterable +[2025-11-04 17:20:47,755] ERROR django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 500 149470 +[2025-11-04 17:31:01,870] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\pos_device\services\services.py changed, reloading. +[2025-11-04 17:31:06,494] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 17:31:10,972] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:31:11,412] ERROR django.request | IP: 127.0.0.1 | Path: /product/pos/api/v1/distributions/rancher_distributions/ | Internal Server Error: /product/pos/api/v1/distributions/rancher_distributions/ +Traceback (most recent call last): + File "D:\Software\env\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\views\decorators\csrf.py", line 65, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\viewsets.py", line 125, in view + return self.dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 515, in dispatch + response = self.handle_exception(exc) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 472, in handle_exception + response = exception_handler(exc, context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 512, in dispatch + response = handler(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py", line 119, in rancher_distributions + return self.get_paginated_response(serializer.data) + ^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 797, in data + ret = super().data + ^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 251, in data + self._data = self.to_representation(self.instance) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 716, in to_representation + self.child.to_representation(item) for item in iterable + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\serializers\quota_distribution_serializers.py", line 124, in to_representation + 'base_prices': quota_pricing_items_by_type(instance.quota, sharing=sharing_list) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\services\services.py", line 107, in quota_pricing_items_by_type + calculate_sharing_total_price = sum(item['amount'] for item in sharing if item['amount'] is not None) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: 'NoneType' object is not iterable +[2025-11-04 17:31:11,420] ERROR django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 500 149470 +[2025-11-04 17:31:43,269] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\pos_device\services\services.py changed, reloading. +[2025-11-04 17:31:45,549] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 17:31:49,804] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:31:50,292] ERROR django.request | IP: 127.0.0.1 | Path: /product/pos/api/v1/distributions/rancher_distributions/ | Internal Server Error: /product/pos/api/v1/distributions/rancher_distributions/ +Traceback (most recent call last): + File "D:\Software\env\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\views\decorators\csrf.py", line 65, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\viewsets.py", line 125, in view + return self.dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 515, in dispatch + response = self.handle_exception(exc) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 472, in handle_exception + response = exception_handler(exc, context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 512, in dispatch + response = handler(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py", line 119, in rancher_distributions + return self.get_paginated_response(serializer.data) + ^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 797, in data + ret = super().data + ^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 251, in data + self._data = self.to_representation(self.instance) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 716, in to_representation + self.child.to_representation(item) for item in iterable + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\serializers\quota_distribution_serializers.py", line 124, in to_representation + 'base_prices': quota_pricing_items_by_type(instance.quota, sharing=sharing_list) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\services\services.py", line 107, in quota_pricing_items_by_type + calculate_sharing_total_price = sum(item['amount'] for item in sharing if item['amount'] is not None) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: 'NoneType' object is not iterable +[2025-11-04 17:31:50,303] ERROR django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 500 149470 +[2025-11-04 17:32:14,967] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\pos_device\services\services.py changed, reloading. +[2025-11-04 17:32:17,326] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 17:32:24,636] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:32:25,126] ERROR django.request | IP: 127.0.0.1 | Path: /product/pos/api/v1/distributions/rancher_distributions/ | Internal Server Error: /product/pos/api/v1/distributions/rancher_distributions/ +Traceback (most recent call last): + File "D:\Software\env\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\views\decorators\csrf.py", line 65, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\viewsets.py", line 125, in view + return self.dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 515, in dispatch + response = self.handle_exception(exc) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 472, in handle_exception + response = exception_handler(exc, context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 512, in dispatch + response = handler(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py", line 119, in rancher_distributions + return self.get_paginated_response(serializer.data) + ^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 797, in data + ret = super().data + ^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 251, in data + self._data = self.to_representation(self.instance) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 716, in to_representation + self.child.to_representation(item) for item in iterable + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\serializers\quota_distribution_serializers.py", line 124, in to_representation + 'base_prices': quota_pricing_items_by_type(instance.quota, sharing=sharing_list) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\services\services.py", line 107, in quota_pricing_items_by_type + calculate_sharing_total_price = sum(item['amount'] for item in sharing if item['amount'] is not None) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: 'NoneType' object is not iterable +[2025-11-04 17:32:25,137] ERROR django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 500 149470 +[2025-11-04 17:32:51,144] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\pos_device\services\services.py changed, reloading. +[2025-11-04 17:32:53,145] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 17:33:07,380] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:33:07,830] ERROR django.request | IP: 127.0.0.1 | Path: /product/pos/api/v1/distributions/rancher_distributions/ | Internal Server Error: /product/pos/api/v1/distributions/rancher_distributions/ +Traceback (most recent call last): + File "D:\Software\env\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\views\decorators\csrf.py", line 65, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\viewsets.py", line 125, in view + return self.dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 515, in dispatch + response = self.handle_exception(exc) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 472, in handle_exception + response = exception_handler(exc, context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 512, in dispatch + response = handler(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py", line 119, in rancher_distributions + return self.get_paginated_response(serializer.data) + ^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 797, in data + ret = super().data + ^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 251, in data + self._data = self.to_representation(self.instance) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 716, in to_representation + self.child.to_representation(item) for item in iterable + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\serializers\quota_distribution_serializers.py", line 124, in to_representation + 'base_prices': quota_pricing_items_by_type(instance.quota, sharing=sharing_list) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\services\services.py", line 107, in quota_pricing_items_by_type + calculate_sharing_total_price = sum(item['amount'] for item in sharing if item['amount'] is not None) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: 'NoneType' object is not iterable +[2025-11-04 17:33:07,837] ERROR django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 500 149470 +[2025-11-04 17:33:50,744] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\pos_device\services\services.py changed, reloading. +[2025-11-04 17:33:52,599] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 17:33:59,977] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:34:00,465] ERROR django.request | IP: 127.0.0.1 | Path: /product/pos/api/v1/distributions/rancher_distributions/ | Internal Server Error: /product/pos/api/v1/distributions/rancher_distributions/ +Traceback (most recent call last): + File "D:\Software\env\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\views\decorators\csrf.py", line 65, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\viewsets.py", line 125, in view + return self.dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 515, in dispatch + response = self.handle_exception(exc) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 472, in handle_exception + response = exception_handler(exc, context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 512, in dispatch + response = handler(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py", line 119, in rancher_distributions + return self.get_paginated_response(serializer.data) + ^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 797, in data + ret = super().data + ^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 251, in data + self._data = self.to_representation(self.instance) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 716, in to_representation + self.child.to_representation(item) for item in iterable + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\serializers\quota_distribution_serializers.py", line 124, in to_representation + 'base_prices': quota_pricing_items_by_type(instance.quota, sharing=sharing_list) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\services\services.py", line 107, in quota_pricing_items_by_type + calculate_sharing_total_price = sum(item['amount'] for item in sharing if item['amount'] is not None) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: 'NoneType' object is not iterable +[2025-11-04 17:34:00,469] ERROR django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 500 149470 +[2025-11-04 17:34:37,319] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\pos_device\services\services.py changed, reloading. +[2025-11-04 17:34:39,279] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 17:34:45,287] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:34:45,775] ERROR django.request | IP: 127.0.0.1 | Path: /product/pos/api/v1/distributions/rancher_distributions/ | Internal Server Error: /product/pos/api/v1/distributions/rancher_distributions/ +Traceback (most recent call last): + File "D:\Software\env\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\views\decorators\csrf.py", line 65, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\viewsets.py", line 125, in view + return self.dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 515, in dispatch + response = self.handle_exception(exc) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 472, in handle_exception + response = exception_handler(exc, context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 512, in dispatch + response = handler(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py", line 119, in rancher_distributions + return self.get_paginated_response(serializer.data) + ^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 797, in data + ret = super().data + ^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 251, in data + self._data = self.to_representation(self.instance) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 716, in to_representation + self.child.to_representation(item) for item in iterable + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\serializers\quota_distribution_serializers.py", line 124, in to_representation + 'base_prices': quota_pricing_items_by_type(instance.quota, sharing=sharing_list) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\services\services.py", line 107, in quota_pricing_items_by_type + calculate_sharing_total_price = sum(item['amount'] for item in sharing if item['amount'] is not None) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: 'NoneType' object is not iterable +[2025-11-04 17:34:45,781] ERROR django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 500 149470 +[2025-11-04 17:36:11,385] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\pos_device\services\services.py changed, reloading. +[2025-11-04 17:36:13,410] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 17:36:20,971] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:36:21,444] ERROR django.request | IP: 127.0.0.1 | Path: /product/pos/api/v1/distributions/rancher_distributions/ | Internal Server Error: /product/pos/api/v1/distributions/rancher_distributions/ +Traceback (most recent call last): + File "D:\Software\env\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\django\views\decorators\csrf.py", line 65, in _view_wrapper + return view_func(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\viewsets.py", line 125, in view + return self.dispatch(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 515, in dispatch + response = self.handle_exception(exc) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 472, in handle_exception + response = exception_handler(exc, context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\views.py", line 512, in dispatch + response = handler(request, *args, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\viewsets\quota_distribution_api.py", line 119, in rancher_distributions + return self.get_paginated_response(serializer.data) + ^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 797, in data + ret = super().data + ^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 251, in data + self._data = self.to_representation(self.instance) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Software\env\Lib\site-packages\rest_framework\serializers.py", line 716, in to_representation + self.child.to_representation(item) for item in iterable + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\pos\api\v1\serializers\quota_distribution_serializers.py", line 124, in to_representation + 'base_prices': quota_pricing_items_by_type(instance.quota, sharing=sharing_list) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "D:\Project\Rasaddam_Backend\apps\product\services\services.py", line 107, in quota_pricing_items_by_type + calculate_sharing_total_price = sum(item['amount'] for item in sharing if item['amount'] is not None) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: 'NoneType' object is not iterable +[2025-11-04 17:36:21,449] ERROR django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 500 149470 +[2025-11-04 17:39:38,229] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\pos_device\services\services.py changed, reloading. +[2025-11-04 17:39:40,039] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 17:39:47,346] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:39:47,934] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 3431 +[2025-11-04 17:41:12,558] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\pos_device\services\services.py changed, reloading. +[2025-11-04 17:41:16,873] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-11-04 17:41:21,231] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions?national_code=4050820765 HTTP/1.1" 301 0 +[2025-11-04 17:41:21,894] INFO django.server | IP: - | Path: - | "GET /product/pos/api/v1/distributions/rancher_distributions/?national_code=4050820765 HTTP/1.1" 200 3431