We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f453c44 commit 43a4840Copy full SHA for 43a4840
localized_fields/fields/localized_field.py
@@ -1,5 +1,6 @@
1
from django.conf import settings
2
from django.db.utils import IntegrityError
3
+
4
from localized_fields import LocalizedFieldForm
5
from psqlextra.fields import HStoreField
6
@@ -17,8 +18,13 @@ class LocalizedField(HStoreField):
17
18
def __init__(self, *args, **kwargs):
19
"""Initializes a new instance of :see:LocalizedField."""
20
- super(LocalizedField, self).__init__(
21
- *args, required=[settings.LANGUAGE_CODE], **kwargs)
+ required = kwargs.get('required')
22
+ if required is None:
23
+ required = [settings.LANGUAGE_CODE]
24
25
+ kwargs['required'] = required
26
27
+ super(LocalizedField, self).__init__(*args, **kwargs)
28
29
@staticmethod
30
def from_db_value(value, *_):
0 commit comments