Skip to content

Commit 22bc86b

Browse files
committed
Merge branch 'master' of github.com:viewflow/django-fsm
2 parents f9ebbb4 + d9effde commit 22bc86b

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ on a model instance with a protected FSMField will cause an exception.
157157

158158
You can use ``*`` for ``source`` to allow switching to ``target`` from any state.
159159

160-
You can use ``+`` for ``source`` to allow switching to ``target`` from any state exluding ``target`` state.
160+
You can use ``+`` for ``source`` to allow switching to ``target`` from any state excluding ``target`` state.
161161

162162
``target`` state
163163
~~~~~~~~~~~~~~~~
@@ -405,7 +405,7 @@ Drawing transitions
405405

406406
Renders a graphical overview of your models states transitions
407407

408-
You need ``pip install graphviz>=0.4`` library and add ``django_fsm`` to
408+
You need ``pip install "graphviz>=0.4"`` library and add ``django_fsm`` to
409409
your ``INSTALLED_APPS``:
410410

411411
.. code:: python

django_fsm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ def _do_update(self, base_qs, using, pk_val, values, update_fields, forced_updat
556556
# INSERT if UPDATE fails.
557557
# Thus, we need to make sure we only catch the case when the object *is* in the DB, but with changed state; and
558558
# mimic standard _do_update behavior otherwise. Django will pick it up and execute _do_insert.
559-
if not updated and base_qs.filter(pk=pk_val).exists():
559+
if not updated and base_qs.filter(pk=pk_val).using(using).exists():
560560
raise ConcurrentTransition("Cannot save object! The state has been changed since fetched from the database!")
561561

562562
return updated

django_fsm/management/commands/graph_transitions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
from django.core.management.base import BaseCommand
77
try:
88
from django.utils.encoding import force_text
9+
_requires_system_checks = True
910
except ImportError: # Django >= 4.0
1011
from django.utils.encoding import force_str as force_text
12+
from django.core.management.base import ALL_CHECKS
13+
_requires_system_checks = ALL_CHECKS
1114

1215
from django_fsm import FSMFieldMixin, GET_STATE, RETURN_VALUE
1316

@@ -135,7 +138,7 @@ def get_graphviz_layouts():
135138

136139

137140
class Command(BaseCommand):
138-
requires_system_checks = True
141+
requires_system_checks = _requires_system_checks
139142

140143
if not HAS_ARGPARSE:
141144
option_list = BaseCommand.option_list + (

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
"Framework :: Django :: 2.2",
3636
"Framework :: Django :: 3.1",
3737
"Framework :: Django :: 3.2",
38+
"Framework :: Django :: 4.0",
39+
"Framework :: Django :: 4.1",
3840
'Programming Language :: Python',
3941
'Programming Language :: Python :: 2.6',
4042
'Programming Language :: Python :: 2.7',

0 commit comments

Comments
 (0)