diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-01-09 11:02:14 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-01-09 11:02:14 +0100 |
commit | 748a112b3bd4cacb2c18e128525196aab977a0c9 (patch) | |
tree | 1708f4ed7251f9e3cb122d50c173815ced7110ff /archaeological_warehouse/models.py | |
parent | 1488f1cbb29d9605e14621982e1450e5801a8fa2 (diff) | |
parent | f40a1a35ec2d87064c3556c81ea7e82de9da1fbd (diff) | |
download | Ishtar-748a112b3bd4cacb2c18e128525196aab977a0c9.tar.bz2 Ishtar-748a112b3bd4cacb2c18e128525196aab977a0c9.zip |
Merge branch 'develop' into develop-bootstrap
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r-- | archaeological_warehouse/models.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index bea55be9b..d6c33583f 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -305,7 +305,7 @@ class Container(LightHistorizedItem, ImageModel): verbose_name = _(u"Container") verbose_name_plural = _(u"Containers") ordering = ('cached_label',) - unique_together = ('index', 'location') + unique_together = ('index', 'responsible') permissions = ( ("view_container", u"Can view all Containers"), ("view_own_container", u"Can view own Container"), @@ -486,8 +486,8 @@ class Container(LightHistorizedItem, ImageModel): updated = False if not self.index: self.skip_history_when_saving = True - q = Container.objects.filter(responsible=self.responsible).order_by( - '-index') + q = Container.objects.filter(responsible=self.responsible).exclude( + pk=self.pk).order_by('-index') if q.count(): self.index = q.all()[0].index + 1 else: |