django-oscar / django-oscar-docdata

Docdata Payments Gateway integration for django-oscar
Apache License 2.0
22 stars 11 forks source link

Issue with default value of merchant_name in DocdataOrder model #1

Closed maerteijn closed 8 years ago

maerteijn commented 8 years ago

Hello.

In the DocdataOrder, the merchant_name is defined as following:

merchant_name = models.CharField(_("Docdata account"), max_length=100, default=appsettings.DOCDATA_MERCHANT_NAME)

When you use the oscar_docdata package and set the DOCDATA_MERCHANT_NAME in your settings.py, the migration framework of Django will detect a change and creates a new migration for this (in the docdata package which is installed as an egg). I'm not sure what is the best way to solve this problem, @vdboor maybe you have some suggestions?

vdboor commented 8 years ago

What I've done in other projects, is using the appsettings.DOCDATA_MERCHANT_NAME variable in the migrations too. However, it could lead to database inconsistencies if you change it. I'm open for a pull request that makes sure the value is set without relying on the default= attribute

maerteijn commented 8 years ago

@vdboor What do you mean with "using the appsettings.DOCDATA_MERCHANT_NAME variable in the migrations too"? Did you create a custom migration yourself or?

vdboor commented 8 years ago

There you go: 539ef9da4d6e2c10f840cc7f3dbac5545262e5e9 This is released as 1.2.9