The dbuser attribute of current_user() will often be a detached ORM instance. It's currently refreshed in an ad-hoc way.
Consider removing this attribute and updating the rest of the code to use the userid attribute instead, getting a User object via the current database session every time it is needed.
The
dbuser
attribute ofcurrent_user()
will often be a detached ORM instance. It's currently refreshed in an ad-hoc way.Consider removing this attribute and updating the rest of the code to use the
userid
attribute instead, getting aUser
object via the current database session every time it is needed.