Closed peterfarrell closed 8 years ago
Cool, thanks for the report. Yes, would certainly accept a PR that fixes this.
I tried a patch where however then we get a transition not allowed error:
https://github.com/peterfarrell/django-fsm-admin/tree/peterfarrell-patch-56
The error goes away if we take out the @fsm_log_by
decorator. We have other transitions setup exactly the same way with the log by decorate that work just fine. So I am suspecting that the issue lies in the the logging package for FSM.
@Nagyman Closing this issue. We discovered it has to do with the why Django FSM Log's decorate deleted the by
kwarg prematurely when calling a transition from another transition in the same object. We will file an issue with that project (and a patch).
If anyone stumble upon this, you can see the issue we filed with Django FSM Log here:
Thanks for the investigation @peterfarrell
When using Django FSM Admin with Django FSM Log on Python 3.4, the call to
trans_func(request=request, by=request.user)
fails with anAttributeError
on the the kwargrequest
and the try/except is only looking forTypeError
. The error reads as follows wheremy_transition
is the name of the transition method:It appears that if we remove the @fsm_log_by decorator then everything works. This is strange because we have several other transitions that have logging that works.
From https://github.com/gadventures/django-fsm-admin/blob/master/fsm_admin/mixins.py#L162-L172