Commit 7788ea53 authored by Alexander Pace's avatar Alexander Pace
Browse files

move model.save() outside of try:

parent deabdb2c
Pipeline #206414 passed with stages
in 9 minutes and 57 seconds
......@@ -131,7 +131,6 @@ class AutoIncrementModel(models.Model):
while this_try < self.max_retries:
try:
self.full_clean()
super(AutoIncrementModel, self).save(*args, **kwargs)
except:
logger.warning("Database integrity error when saving {}. ",
"Incrementing and retrying.".format(self))
......@@ -139,6 +138,7 @@ class AutoIncrementModel(models.Model):
getattr(self,self.AUTO_FIELD) + 1)
this_try += 1
else:
super(AutoIncrementModel, self).save(*args, **kwargs)
break
def auto_increment_update(self, update_field_name, constraints=[],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment