mirror of
https://github.com/jazzband/django-constance.git
synced 2026-03-16 22:40:24 +00:00
Fix #396
This commit is contained in:
parent
731514c52f
commit
96bd3e1047
1 changed files with 4 additions and 0 deletions
|
|
@ -19,6 +19,7 @@ from django.utils import timezone
|
|||
from django.utils.encoding import smart_bytes
|
||||
from django.utils.formats import localize
|
||||
from django.utils.module_loading import import_string
|
||||
from django.utils.text import normalize_newlines
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from . import LazyConfig, settings
|
||||
|
|
@ -146,6 +147,9 @@ class ConstanceForm(forms.Form):
|
|||
current = getattr(config, name)
|
||||
new = self.cleaned_data[name]
|
||||
|
||||
if isinstance(new, str):
|
||||
new = normalize_newlines(new)
|
||||
|
||||
if conf.settings.USE_TZ and isinstance(current, datetime) and not timezone.is_aware(current):
|
||||
current = timezone.make_aware(current)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue