diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-04-19 10:21:37 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-04-19 10:21:37 +0200 |
commit | 016c49d7a9b149720c75501525f79f19a73ff3b3 (patch) | |
tree | 60fb8dbf5cd76ab46ccfdf975b216999c6d3315d /archaeological_finds | |
parent | 270d2a3735ec65b58bdb23678aaede1b0ff90b7d (diff) | |
download | Ishtar-016c49d7a9b149720c75501525f79f19a73ff3b3.tar.bz2 Ishtar-016c49d7a9b149720c75501525f79f19a73ff3b3.zip |
Django 1.8: remove transaction.commit_unless_managed
Diffstat (limited to 'archaeological_finds')
-rw-r--r-- | archaeological_finds/models_finds.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index b5e58a98b..6e920bc7d 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -430,10 +430,8 @@ class BaseFind(BaseHistorizedItem, OwnPerms): ope_prefix=settings.ISHTAR_DEF_OPE_PREFIX, join=settings.JOINT, filters=filters, zeros=settings.ISHTAR_FINDS_INDEX_ZERO_LEN * "0") - # with connection.cursor() as c: # django 1.8 - c = connection.cursor() - c.execute(sql, args) - transaction.commit_unless_managed() + with connection.cursor() as c: + c.execute(sql, args) cls._meta.get_field_by_name( 'find')[0].model.cached_label_bulk_update(**kwargs) @@ -983,10 +981,8 @@ class Find(ValueGetter, BaseHistorizedItem, ImageModel, OwnPerms, ope_prefix=settings.ISHTAR_DEF_OPE_PREFIX, join=settings.JOINT, filters=filters, zeros=settings.ISHTAR_FINDS_INDEX_ZERO_LEN * "0") - # with connection.cursor() as c: # django 1.8 - c = connection.cursor() - c.execute(sql, args) - transaction.commit_unless_managed() + with connection.cursor() as c: + c.execute(sql, args) def save(self, *args, **kwargs): super(Find, self).save(*args, **kwargs) |