Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cherry picked 16b4f1e

  • Loading branch information...
commit bb47153e05b46b775658887f214a486412fe25a5 1 parent 85b75da
@ojii authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 nani/forms.py
View
11 nani/forms.py
@@ -62,10 +62,10 @@ def __new__(cls, name, bases, attrs):
texclude = [field for field in opts.exclude or [] if field not in shared_fields]
# required by fields_for_model
- if not sfieldnames:
- sfieldnames = None
+ if not sfieldnames :
+ sfieldnames = None if not fields else []
if not tfieldnames:
- tfieldnames = None
+ tfieldnames = None if not fields else []
# If a model is defined, extract form fields from it.
sfields = fields_for_model(opts.model, sfieldnames, sexclude,
@@ -150,10 +150,11 @@ def save(self, commit=True):
trans = trans_model()
else:
trans = trans_model()
- trans = save_instance(self, trans, self._meta.fields, fail_message,
- commit, construct=True)
+
trans.language_code = language_code
trans.master = self.instance
+ trans = save_instance(self, trans, self._meta.fields, fail_message,
+ commit, construct=True)
return combine(trans)
def _post_clean(self):
Please sign in to comment.
Something went wrong with that request. Please try again.