mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-23 06:22:24 +01:00
Copy locale to User model
This commit is contained in:
parent
3b354de2fc
commit
95b3c66366
@ -131,6 +131,14 @@ def get_locale():
|
|||||||
|
|
||||||
locale = request.cookies.get("locale")
|
locale = request.cookies.get("locale")
|
||||||
if locale in locales:
|
if locale in locales:
|
||||||
|
if current_user.is_authenticated:
|
||||||
|
new_session = models.db.create_session({})()
|
||||||
|
new_session.query(models.User) \
|
||||||
|
.filter(models.User.username == current_user.username) \
|
||||||
|
.update({ "locale": locale })
|
||||||
|
new_session.commit()
|
||||||
|
new_session.close()
|
||||||
|
|
||||||
return locale
|
return locale
|
||||||
|
|
||||||
return request.accept_languages.best_match(locales)
|
return request.accept_languages.best_match(locales)
|
||||||
|
Loading…
Reference in New Issue
Block a user