Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Missing migrations #62

Open
AzMoo opened this issue Jan 3, 2018 · 2 comments
Open

Missing migrations #62

AzMoo opened this issue Jan 3, 2018 · 2 comments

Comments

@AzMoo
Copy link

AzMoo commented Jan 3, 2018

When installing into Django 1.11 on Python3.6 there are a number of AlterField migrations missing.

If I run makemigrations I get:

Migrations for 'djangocms_forms':
  ~/lib/python3.6/site-packages/djangocms_forms/migrations/0006_auto_20180104_0929.py
    - Alter field cmsplugin_ptr on formdefinition
    - Alter field form_template on formdefinition
    - Alter field field_type on formfield
    - Alter field ip on formsubmission

Ideally these migrations could be added and deployed to PyPI. If you like I can submit a pull request with them but it might be easier for you to do it yourself if you've got a dev environment set up already.

@mishbahr
Copy link
Owner

mishbahr commented Jun 7, 2018

Looking into this.

Alter field cmsplugin_ptr on formdefinition

By default on_delete behaviour used to be django.db.models.CASCADE
We can modify the initial migration to just add that.

Alter field form_template on formdefinition
Alter field field_type on formfield

Both of the fields are "settings" driven.

i.e if someone changes settings.DJANGOCMS_FORMS_TEMPLATES
or settings.DJANGOCMS_FORMS_FIELD_TYPES

This will make django complain about missing migrations!

What we should do is update original migration and change "choices" value to point to settings.

e.g https://github.com/mishbahr/djangocms-forms/blob/master/djangocms_forms/migrations/0001_initial.py#L63

... choices=settings.DJANGOCMS_FORMS_FIELD_TYPES

or https://github.com/mishbahr/djangocms-forms/blob/master/djangocms_forms/migrations/0001_initial.py#L49

should use settings. DJANGOCMS_FORMS_TEMPLATES

Finalllly...

Alter field ip on formsubmission

This is a minor bug. Nothing has changed for the field.

Except the verbose name is not wrapped in ugettext_lazy function i.e _('...')
so I bet python 3 it thinks its string now and before it was byte.

This can probably be fixed by changing this line...

https://github.com/mishbahr/djangocms-forms/blob/master/djangocms_forms/models.py#L230

ip = models.GenericIPAddressField(verbose_name=_('IP'), blank=True, null=True)

FYI @riclima if you update your merge request with the above suggestions... I'll be happy to merge it.

Sorry, it took me this long to look into it. I've been super busy recently and I actually haven't used this package or django-cms for years now.

@jedie
Copy link

jedie commented Aug 6, 2019

Run into the same issues... Nothing done, yet, isn't it?

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

Successfully merging a pull request may close this issue.

3 participants