Fixed error on category numbering. Fixed #3315.
This commit is contained in:
parent
77a321894b
commit
41a70f40df
@ -18,6 +18,7 @@ Motions:
|
|||||||
- Fixed issue when creating/deleting motion comment fields in the
|
- Fixed issue when creating/deleting motion comment fields in the
|
||||||
settings [#3187].
|
settings [#3187].
|
||||||
- Fixed empty motion comment field in motion update form [#3194].
|
- Fixed empty motion comment field in motion update form [#3194].
|
||||||
|
- Fixed error on category sort [#3318].
|
||||||
- Removed server side image to base64 transformation and
|
- Removed server side image to base64 transformation and
|
||||||
added local transformation [#3181]
|
added local transformation [#3181]
|
||||||
- Added support for export motions in a ZIP archive [#3189].
|
- Added support for export motions in a ZIP archive [#3189].
|
||||||
|
@ -233,11 +233,17 @@ class Motion(RESTModelMixin, models.Model):
|
|||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
super(Motion, self).save(skip_autoupdate=True, *args, **kwargs)
|
super(Motion, self).save(skip_autoupdate=True, *args, **kwargs)
|
||||||
except IntegrityError:
|
except IntegrityError:
|
||||||
# Identifier is already used. Calculate a new one and try again.
|
# Identifier is already used.
|
||||||
self.identifier_number, self.identifier = self.increment_identifier_number(
|
if hasattr(self, '_identifier_prefix'):
|
||||||
self.identifier_number,
|
# Calculate a new one and try again.
|
||||||
self._identifier_prefix,
|
self.identifier_number, self.identifier = self.increment_identifier_number(
|
||||||
)
|
self.identifier_number,
|
||||||
|
self._identifier_prefix,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
# Do not calculate a new one but reraise the IntegrityError.
|
||||||
|
# The error is caught in the category sort view.
|
||||||
|
raise
|
||||||
else:
|
else:
|
||||||
# Save was successful. End loop.
|
# Save was successful. End loop.
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user