File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919from django .db .models .signals import post_save
2020from django .utils .encoding import python_2_unicode_compatible
2121from django_fsm import FSMField , transition
22+ from django_fsm .signals import post_transition
2223from json_field .fields import JSONField
2324
2425from api import fields , tasks
@@ -536,6 +537,13 @@ def _etcd_purge_user(**kwargs):
536537post_save .connect (_log_release_created , sender = Release , dispatch_uid = 'api.models' )
537538post_save .connect (_log_config_updated , sender = Config , dispatch_uid = 'api.models' )
538539
540+
541+ # save FSM transitions as they happen
542+ def _save_transition (** kwargs ):
543+ kwargs ['instance' ].save ()
544+
545+ post_transition .connect (_save_transition )
546+
539547# wire up etcd publishing if we can connect
540548try :
541549 _etcd_client = etcd .Client (host = settings .ETCD_HOST , port = int (settings .ETCD_PORT ))
You can’t perform that action at this time.
0 commit comments