Comments (3)
@gogobook Thanks for the clarification.
Note that you are reporting this against a development version of Oscar, not the official supported versions as stated in the docs
Now that's been said: It's actually not an issue of oscarapi
. However, I created a pull request for Oscar to fix this: django-oscar/django-oscar#2682
I will close this issue when it's merged.
from django-oscar-api.
As you can see on travis , the tests do pass. Can you explain a bit more please. "testoffer.py and testbasket.py is an error." is a bit vague.
from django-oscar-api.
When I try to develop oscarapi with oscar(338cb7c), I get "NoneType" error by follow message
File ".../oscarapi/views/basket.py", line 78, in validate
allowed, message = basket.is_quantity_allowed(quantity)
File ".../oscar/apps/basket/abstract_models.py", line155, in is_quantity_allowed
max_allowed, basket_threshold = self.max_allowed_quantity()
TypeError: 'NoneType' object is not iterable
This is some source code of oscar(338cb7c) in basket/abstract_models.py:
def max_allowed_quantity(self):
"""
Returns maximum product quantity, that can be added to the basket
with the respect to basket quantity threshold.
"""
basket_threshold = settings.OSCAR_MAX_BASKET_QUANTITY_THRESHOLD
if basket_threshold:
total_basket_quantity = self.num_items
max_allowed = basket_threshold - total_basket_quantity
return max_allowed, basket_threshold
def is_quantity_allowed(self, qty):
"""
Test whether the passed quantity of items can be added to the basket
"""
# We enforce a max threshold to prevent a DOS attack via the offers
# system.
max_allowed, basket_threshold = self.max_allowed_quantity()
if max_allowed is not None and qty > max_allowed:
return False, _(
"Due to technical limitations we are not able "
"to ship more than %(threshold)d items in one order.") \
% {'threshold': basket_threshold}
return True, None
if setup "settings.OSCAR_MAX_BASKET_QUANTITY_THRESHOLD = None" will get TypeError: 'NoneType' object is not iterable.
from django-oscar-api.
Related Issues (20)
- the sandbox doesn't work due to incompatable version of django getting installed. HOT 4
- ImageUrlField is causing an error HOT 13
- Voucher application with suspended offer HOT 1
- Unable to create an account HOT 1
- How to Login with react js HOT 16
- How to Overwrite Oscar API URL ? HOT 1
- getting HOT 2
- Weird results in attributes with patching Childs HOT 3
- AttributeError: 'NoneType' object has no attribute 'strategy' HOT 3
- Is there any good way to make price range filter with oscar api? HOT 1
- Why doesn't ProductList filter out non-public products?
- AdminProductSerializer validation
- `cookies_to_delete` is always an empty list HOT 12
- AdminProductSerializer error when trying to add products HOT 1
- Voucher discount is applied to every single product in the basket
- Add to basket api returns 403 forbidden when user is logged in HOT 5
- ImproperlyConfigured at /api/admin/products/ when a Product has an optiongroup HOT 13
- master ahead of main? HOT 1
- _ in both ApiBasketMiddleWare and translations?
- Potential problem with basket for unauthenticated users
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-oscar-api.