Skip to content

Commit

Permalink
use six.reraise
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelKimmig committed Nov 23, 2015
1 parent 72609d6 commit 0d8bb19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django_dynamic_fixture/ddf.py
Expand Up @@ -382,11 +382,11 @@ def set_data_for_a_field(self, model_class, __instance, __field, persist_depende
LOGGER.debug('%s.%s = %s' % (get_unique_model_name(model_class), __field.name, data))
try:
setattr(__instance, __field.name, data) # Model.field = data
except ValueError:
except ValueError as e:
if is_relationship_field(__field):
setattr(__instance, "%s_id" % __field.name, data) # Model.field = data
else:
raise
six.reraise(*sys.exc_info())
self.fields_processed.append(__field.name)

def _validate_kwargs(self, model_class, kwargs):
Expand Down

0 comments on commit 0d8bb19

Please sign in to comment.