Conversation
| session = Session.objects.get(session_key=session_id) | ||
| except Session.DoesNotExist: | ||
| session = None | ||
| engine = import_module(settings.SESSION_ENGINE) |
There was a problem hiding this comment.
I don't particularly mind this flow, but is there a less brutal way of doing this for users that do not require as much flexibility in the call flow? Maybe a new settings flag?
Also, is there harm in resolving the engine in the module scope, as opposed to the function scope? (Perhaps there is, like a django init thing, but wanted to ask just in case there was no danger.)
There was a problem hiding this comment.
Are you referring to the use of import_module? It's the recommended way in the Django docs. If the user is retrieved from request.user this would not be required at all actually (see my comment in #165).
I agree that the session store should be retrieved once instead of each request. Maybe move it to the top of the module where audit_logger is defined?
jheld
left a comment
There was a problem hiding this comment.
Just some thoughts and look forward to your insight.
|
I decided to test django-easy-audit and I liked this project. |
Allow getting the user from the cache, not only from django-db. Using SessionStore abstraction.