Skip to content

Commit e3ae61a

Browse files
committed
updates
1 parent fba78f1 commit e3ae61a

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

CHANGES

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
Release 2.5
2+
-----------
3+
* removes deprecatd MANUAL_TRIGGERS
4+
* drop support Django 2.x
5+
* drop support python 3.8
6+
7+
18
Release 2.4
29
-----------
310
* add support Django 4

src/concurrency/admin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from django.utils.encoding import force_str
1515
from django.utils.safestring import mark_safe
1616
from django.utils.translation import ngettext
17+
from django.db import transaction
1718

1819
from concurrency import core, forms
1920
from concurrency.api import get_revision_of_object
@@ -197,6 +198,7 @@ def _get_conflicts(self, request):
197198
else:
198199
return []
199200

201+
@transaction.atomic()
200202
def save_model(self, request, obj, form, change):
201203
try:
202204
if change:

src/concurrency/config.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
from .compat import get_callable
88

99
# List Editable Policy
10-
# 0 do not save updated records, save others, show message to the user
11-
# 1 abort whole transaction
10+
# 1 do not save updated records, save others, show message to the user
11+
# 2 abort whole transaction
1212
CONCURRENCY_LIST_EDITABLE_POLICY_SILENT = 1
1313
CONCURRENCY_LIST_EDITABLE_POLICY_ABORT_ALL = 2
1414
CONCURRENCY_POLICY_RAISE = 4
@@ -21,7 +21,6 @@ class AppSettings:
2121
defaults = {
2222
'ENABLED': True,
2323
'AUTO_CREATE_TRIGGERS': True,
24-
'MANUAL_TRIGGERS': False, # deprecated: use AUTO_CREATE_TRIGGERS
2524
'FIELD_SIGNER': 'concurrency.forms.VersionFieldSigner',
2625
'POLICY': CONCURRENCY_LIST_EDITABLE_POLICY_SILENT,
2726
'CALLBACK': 'concurrency.views.callback',
@@ -67,10 +66,6 @@ def _set_attr(self, prefix_name, value):
6766
"{} is not a valid value for `CALLBACK`. It must be a callable or a fullpath to callable. ".format(
6867
value))
6968
self._callback = func
70-
elif name == "MANUAL_TRIGGERS":
71-
warnings.warn("MANUAL_TRIGGERS is deprecated and will be removed in 2.5. Use AUTO_CREATE_TRIGGERS",
72-
category=DeprecationWarning)
73-
self.AUTO_CREATE_TRIGGERS = not value
7469
elif name == "TRIGGERS_FACTORY":
7570
original = dict(value)
7671
for k, v in original.items():

tests/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def pytest_configure():
2020

2121
settings.SILENCED_SYSTEM_CHECKS = ['concurrency.W001']
2222
settings.CONCURRENCY_VERSION_FIELD_REQUIRED = False
23-
settings.CONCURRENCY_MANUAL_TRIGGERS = False
2423
settings.CONCURRENCY_AUTO_CREATE_TRIGGERS = True
2524

2625

tox.ini

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = d{22,32,40,41}-py{38,39,310}-{pg,sqlite,mysql}
2+
envlist = d{32,42}-py{39,311}-{pg,sqlite,mysql}
33

44

55
[pytest]
@@ -36,6 +36,7 @@ whitelist_externals =
3636
/usr/bin/psql
3737
changedir={toxinidir}
3838
setenv =
39+
PYTHONPATH =
3940
DBNAME = concurrency
4041
pg: DBENGINE = pg
4142
mysql: DBENGINE = mysql
@@ -56,10 +57,8 @@ deps =
5657
pypy-pg: psycopg2cffi
5758
mysql: mysqlclient
5859
docs: -rdocs/requirements.pip
59-
d22: django==2.2.*
6060
d32: django==3.2.*
61-
d40: django==4.0.*
62-
d41: django==4.1.*
61+
d41: django==4.3.*
6362

6463

6564
commands =

0 commit comments

Comments
 (0)