I have a strange question about session management.
I implemented a form chain and after forms are completed a model is saved to database but that model has fields like create_user, update_user and so on.
In order to fill these user fields,of course, there should be an authenticated user.However, my form chain can be filled by anonymous user, as well.
If that anonymous user registers or logins to the system before his session flushs, his user_id should be assigned to create_user and update_user fields..
What is the best way to implement such system ?
I hope I explain the situation.
Thanks
When your model is saved save the model instance to a list in your session, for example:
views.py:
in your login method after logging in (depends on your implementation offcourse) you can update these as follows: