divio / aldryn-forms

Flexible HTML forms for your django CMS projects
Other
40 stars 67 forks source link

wrong import of "mark_save" inside aldryn_forms_tags.py #195

Closed Qadosch closed 4 years ago

Qadosch commented 4 years ago

from django.utils.text import mark_safe https://github.com/divio/aldryn-forms/blob/master/aldryn_forms/templatetags/aldryn_forms_tags.py

based on djangos github mark_save is inside savestring seems like an error based on django 2.1.x to 2.2.x update https://github.com/django/django/blob/master/django/utils/safestring.py

getting this error on divio project deploy after installing forms update: django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'aldryn_forms.templatetags.aldryn_forms_tags': cannot import name 'mark_safe' [0m

macolo commented 4 years ago

@Qadosch aldryn-forms is not yet compatible with django >2. Try django 1.11

Qadosch commented 4 years ago

I figured that. I cannot use django 1.11 since i am using divio cloud and their automatisms and dont want to care about compatibilities. Ill have to wait till divio patches that on their part.

Looks like an small fuckup of @FinalAngel or @vThaian I recomend changing from django.utils.text import mark_safe to from django.utils.savestring import mark_safe

macolo commented 4 years ago

@Qadosch hm it appears you are right and divio cloud sets up django 2.2 by default

image

You can however try to downgrade your aldryn-django addon to 1.11 in the versions tab.

But indeed aldryn forms should be compatible with django 2.2 🤔

macolo commented 4 years ago

There is a merge request here that should be merged: https://github.com/divio/aldryn-forms/pull/194

macolo commented 4 years ago

cc @victor-yunenko

viktor-yunenko commented 4 years ago

I saw this problem. It’s possible to downgrade on divio to 2.1 by downgrading aldryn-addons, that’s what I’ve done - aldryn-forms supports it.

The MR works as well.

viktor-yunenko commented 4 years ago

We've received access to the repository and now can resolve it. I expect the fix to be released in a week.

For now I'll close it in favor of an older issue #191 and the #188.

didierCH commented 4 years ago

from django.utils.savestring import mark_safe

except that it must be

from django.utils.safestring import mark_safe

it works.