ob-dj-store 0.0.19.4__py3-none-any.whl → 0.0.19.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import calendar
2
2
  import logging
3
3
  import typing
4
- from datetime import time, timedelta
4
+ from datetime import timedelta
5
5
  from decimal import Decimal
6
6
 
7
7
  import pycountry
@@ -56,7 +56,7 @@ from ob_dj_store.core.stores.models import (
56
56
  WalletTransaction,
57
57
  )
58
58
  from ob_dj_store.core.stores.models._inventory import Inventory
59
- from ob_dj_store.core.stores.utils import PartnerAuth, distance
59
+ from ob_dj_store.core.stores.utils import PartnerAuth, distance, get_currency_by_country
60
60
 
61
61
  logger = logging.getLogger(__name__)
62
62
 
@@ -405,9 +405,12 @@ class OrderSerializer(serializers.ModelSerializer):
405
405
  from_hour = op_hour.from_hour
406
406
  to_hour = op_hour.to_hour
407
407
  if store.currency == "AED":
408
- from_hour = time(from_hour.hour + 1, from_hour.minute, from_hour.second)
409
- to_hour = time(to_hour.hour + 1, to_hour.minute, to_hour.second)
410
-
408
+ try:
409
+ pickup_time_time += timedelta(hours=1)
410
+ except Exception as e:
411
+ logger.info(
412
+ f"The fix for UAE stores timezone failed due to this error {e}"
413
+ )
411
414
  if store.is_open_after_midnight:
412
415
  if to_hour < pickup_time_time < from_hour:
413
416
  raise serializers.ValidationError(
@@ -535,7 +538,12 @@ class OrderSerializer(serializers.ModelSerializer):
535
538
  amount = gift_details["price"]
536
539
  order = Order.objects.create(customer=user, **validated_data)
537
540
  orders.append(order)
538
- currency = gift_details["currency"]
541
+ try:
542
+ default_currency = get_currency_by_country(user.country.code)
543
+ except Exception as e:
544
+ default_currency = "KWD"
545
+ logger.info(f"Couldn't fetch currency due to this error {e}")
546
+ currency = gift_details.get("currency", default_currency)
539
547
  else:
540
548
  cart = user.cart
541
549
  stores = Store.objects.filter(store_items__cart=cart).distinct()
@@ -84,6 +84,8 @@ class StoreAdmin(LeafletGeoAdmin):
84
84
  "minimum_order_amount",
85
85
  "delivery_charges",
86
86
  "min_free_delivery_amount",
87
+ "created_at",
88
+ "updated_at",
87
89
  ]
88
90
  # define the pickup addresses field as a ManyToManyField
89
91
  # to the address model
@@ -149,7 +151,7 @@ class CategoryAdmin(admin.ModelAdmin):
149
151
  )
150
152
 
151
153
 
152
- class ProductVariantAdmin(admin.ModelAdmin):
154
+ class ProductVariantAdmin(ImportExportModelAdmin, admin.ModelAdmin):
153
155
  inlines = [
154
156
  InventoryInlineAdmin,
155
157
  ProductAttributeInlineAdmin,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ob-dj-store
3
- Version: 0.0.19.4
3
+ Version: 0.0.19.6
4
4
  Summary: OBytes django application for managing ecommerce stores.
5
5
  Home-page: https://www.obytes.com/
6
6
  Author: OBytes
@@ -3,14 +3,14 @@ ob_dj_store/apis/stores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
3
3
  ob_dj_store/apis/stores/filters.py,sha256=zKBXPBoqIyFlSeZOECp97RTWvSLqNPnlPhEp7p8W5tE,9702
4
4
  ob_dj_store/apis/stores/urls.py,sha256=7vwogfIGcKS0hHYK3iBXKQwi1kCA_vuHY1eZt8rAspg,2021
5
5
  ob_dj_store/apis/stores/views.py,sha256=aE4LFPHzs_CtzZ8K5-vAbDn_51hyhi0KIsi7cV8dpkA,43372
6
- ob_dj_store/apis/stores/rest/serializers/serializers.py,sha256=WEhhBGimQS-hOBGrtdvexVtq2Z0wU2RR_ZyPgqOVVJs,64029
6
+ ob_dj_store/apis/stores/rest/serializers/serializers.py,sha256=vpO_IXF2Fqfy7ML013nWRLeXAVZmpf3pLavotLaEr-M,64410
7
7
  ob_dj_store/apis/tap/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  ob_dj_store/apis/tap/serializers.py,sha256=KPrBK4h2-fWvEVf6vOj2ww5-USV9WqpyYicIqoHIiXI,1065
9
9
  ob_dj_store/apis/tap/urls.py,sha256=bnOTv6an11kxpo_FdqlhsizlGPLVpNxBjCyKcf3_C9M,367
10
10
  ob_dj_store/apis/tap/views.py,sha256=vG0rC-PQHCnrbNsPW1gClx0rkaIjALEAuj5cQKmCTo0,2664
11
11
  ob_dj_store/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  ob_dj_store/core/stores/__init__.py,sha256=-izNGrxNn_nn3IQXd5pkuES9lSF-AHYb14yhNPozYCI,65
13
- ob_dj_store/core/stores/admin.py,sha256=oHqzB8lc8A5clzo4tDTAROIAMDGxUXou5jdD-wmrlHQ,14435
13
+ ob_dj_store/core/stores/admin.py,sha256=fGjjpDkPzQM2Fwo5yGzeoeSpX2CW2RJQ4kfftD5NwyM,14503
14
14
  ob_dj_store/core/stores/admin_inlines.py,sha256=2K8iDmP4h0CLIOqy3x-ZXXpgYnT2jqL4cg5YFdiho8s,2976
15
15
  ob_dj_store/core/stores/apps.py,sha256=ZadmEER_dNcQTH617b3fAsYZJSyRw0g46Kjp4eOAsOU,498
16
16
  ob_dj_store/core/stores/managers.py,sha256=lz2CE4PJCI1ViO-CU61LqTr43O41aGRQkbWZUR5Fmfg,9909
@@ -155,7 +155,7 @@ ob_dj_store/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
155
155
  ob_dj_store/utils/helpers.py,sha256=o7wgypM7mI2vZqZKkhxnTcnHJC8GMQDOuYMnRwXr6tY,2058
156
156
  ob_dj_store/utils/model.py,sha256=DV7hOhTaZL3gh9sptts2jTUFlTArKG3i7oPioq9HLFE,303
157
157
  ob_dj_store/utils/utils.py,sha256=8UVAFB56qUSjJJ5f9vnermtw638gdFy4CFRCuMbns_M,1342
158
- ob_dj_store-0.0.19.4.dist-info/METADATA,sha256=NASBbqSP9CQtYc8W1kGDCZDjmUtIhzkTQZlqr6DpUl0,2827
159
- ob_dj_store-0.0.19.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
160
- ob_dj_store-0.0.19.4.dist-info/top_level.txt,sha256=CZG3G0ptTkzGnc0dFYN-ZD7YKdJBmm47bsmGwofD_lk,12
161
- ob_dj_store-0.0.19.4.dist-info/RECORD,,
158
+ ob_dj_store-0.0.19.6.dist-info/METADATA,sha256=rqdkn9xKtui3jW-njVv9yaS0UzwCqytDb_GllHO_p8o,2827
159
+ ob_dj_store-0.0.19.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
160
+ ob_dj_store-0.0.19.6.dist-info/top_level.txt,sha256=CZG3G0ptTkzGnc0dFYN-ZD7YKdJBmm47bsmGwofD_lk,12
161
+ ob_dj_store-0.0.19.6.dist-info/RECORD,,