Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when forking offer.benefits #4234

Open
dylanGerlach opened this issue Jan 24, 2024 · 0 comments
Open

Bug when forking offer.benefits #4234

dylanGerlach opened this issue Jan 24, 2024 · 0 comments

Comments

@dylanGerlach
Copy link

Issue Summary

When forking offer, and overriding the class in the benefits file, you get this error: raise RuntimeError(
RuntimeError: Conflicting 'percentagediscountbenefit' models in application 'offer': <class 'apps.offer.benefits.PercentageDiscountBenefit'> and <class 'oscar.apps.offer.benefits.PercentageDiscountBenefit'>. In offer/models.py the specific files are referenced which I know is against django-oscars development process, but the changes I tried to make to that as a quick fix didn't work.
--- # Import the benefits and the conditions. Required after initializing the

parent models to allow overriding them

from oscar.apps.offer.benefits import *
from oscar.apps.offer.conditions import *

from oscar.apps.offer.benefits import all as benefit_classes
from oscar.apps.offer.conditions import all as condition_classes

all.extend(benefit_classes)
all.extend(condition_classes) ---

Steps to Reproduce

Just fork the offer.benefits and override a class, I specifically am trying to override PercentageDiscountBenefit

Technical details

Python 3.10.11
Name: Django
Version: 4.2.9
Name: django-oscar
Version: 3.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant