Set the context's user when fetching user preferences
The call to _get_preferences makes some processing based on the user of the context. In order for those computations to return the right value the context must be set when instanciating the user. issue3068 review1711002
This commit is contained in:
+1
-1
@@ -337,7 +337,7 @@ class User(ModelSQL, ModelView):
|
||||
if preferences is not None:
|
||||
return preferences.copy()
|
||||
user = Transaction().user
|
||||
with Transaction().set_user(0):
|
||||
with Transaction().set_user(0, set_context=True):
|
||||
user = cls(user)
|
||||
preferences = cls._get_preferences(user, context_only=context_only)
|
||||
cls._get_preferences_cache.set(key, preferences)
|
||||
|
||||
Reference in New Issue
Block a user