ob-dj-store 0.0.21.4__py3-none-any.whl → 0.0.21.5__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.
- ob_dj_store/core/stores/models/_product.py +8 -2
- {ob_dj_store-0.0.21.4.dist-info → ob_dj_store-0.0.21.5.dist-info}/METADATA +1 -1
- {ob_dj_store-0.0.21.4.dist-info → ob_dj_store-0.0.21.5.dist-info}/RECORD +5 -5
- {ob_dj_store-0.0.21.4.dist-info → ob_dj_store-0.0.21.5.dist-info}/WHEEL +0 -0
- {ob_dj_store-0.0.21.4.dist-info → ob_dj_store-0.0.21.5.dist-info}/top_level.txt +0 -0
@@ -250,10 +250,16 @@ class Product(DjangoModelCleanMixin, models.Model):
|
|
250
250
|
|
251
251
|
def get_inventory(self, store_id):
|
252
252
|
try:
|
253
|
-
|
253
|
+
# Prefer the primary variant if available
|
254
|
+
product_variant = (
|
255
|
+
self.product_variants.filter(inventories__is_primary=True).first()
|
256
|
+
or self.product_variants.first()
|
257
|
+
)
|
258
|
+
if not product_variant:
|
259
|
+
return None
|
260
|
+
return product_variant.inventories.get(store_id=store_id)
|
254
261
|
except ObjectDoesNotExist:
|
255
262
|
return None
|
256
|
-
return inventory
|
257
263
|
|
258
264
|
def is_snoozed(self, store_id):
|
259
265
|
try:
|
@@ -153,14 +153,14 @@ ob_dj_store/core/stores/models/_inventory.py,sha256=_rGlVL5HjOlHQVB8CI0776CPcE5r
|
|
153
153
|
ob_dj_store/core/stores/models/_order.py,sha256=_08lqX5p4brCdUilqfbT--6Ao2TMsqnzXaWoV_7IYL8,9758
|
154
154
|
ob_dj_store/core/stores/models/_partner.py,sha256=OuYvevUWn1sYHs9PcFf51EUUC1uqytQss8Bx91aMOH8,4732
|
155
155
|
ob_dj_store/core/stores/models/_payment.py,sha256=FTV-NmvQjxwwR5C5X7qYWV-ZUIZfqMMEjkBNaS-drLs,6421
|
156
|
-
ob_dj_store/core/stores/models/_product.py,sha256=
|
156
|
+
ob_dj_store/core/stores/models/_product.py,sha256=KUi2hkA4VNCrWwWp3AM_tkubFptpOdiFt0Twzi2wW14,18535
|
157
157
|
ob_dj_store/core/stores/models/_store.py,sha256=0K-CNJWuXNqeyULL1J0M9hiNcVla0UNNjdCdN_nzNEE,9833
|
158
158
|
ob_dj_store/core/stores/models/_wallet.py,sha256=YvT-rvED-jrYjePLJpvdLXXoBudR6TGPu5cNE0m2fWo,5643
|
159
159
|
ob_dj_store/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
160
160
|
ob_dj_store/utils/helpers.py,sha256=o7wgypM7mI2vZqZKkhxnTcnHJC8GMQDOuYMnRwXr6tY,2058
|
161
161
|
ob_dj_store/utils/model.py,sha256=DV7hOhTaZL3gh9sptts2jTUFlTArKG3i7oPioq9HLFE,303
|
162
162
|
ob_dj_store/utils/utils.py,sha256=8UVAFB56qUSjJJ5f9vnermtw638gdFy4CFRCuMbns_M,1342
|
163
|
-
ob_dj_store-0.0.21.
|
164
|
-
ob_dj_store-0.0.21.
|
165
|
-
ob_dj_store-0.0.21.
|
166
|
-
ob_dj_store-0.0.21.
|
163
|
+
ob_dj_store-0.0.21.5.dist-info/METADATA,sha256=K_XMw3wkfDg8n81xaZl2MErFWttOueqlGJqzuf_7pfQ,2850
|
164
|
+
ob_dj_store-0.0.21.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
165
|
+
ob_dj_store-0.0.21.5.dist-info/top_level.txt,sha256=CZG3G0ptTkzGnc0dFYN-ZD7YKdJBmm47bsmGwofD_lk,12
|
166
|
+
ob_dj_store-0.0.21.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|