From f9d6384e7a6b5a4a3c89348ae0f68bcc7f552b0f Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Mon, 25 Mar 2024 12:00:47 +0100 Subject: [PATCH] fix langs --- crates/db_schema/src/impls/local_user.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/db_schema/src/impls/local_user.rs b/crates/db_schema/src/impls/local_user.rs index 55b0991a6..944557be5 100644 --- a/crates/db_schema/src/impls/local_user.rs +++ b/crates/db_schema/src/impls/local_user.rs @@ -2,6 +2,7 @@ use crate::{ newtypes::{DbUrl, LocalUserId, PersonId}, schema::{local_user, person, registration_application}, source::{ + actor_language::LocalUserLanguage, local_user::{LocalUser, LocalUserInsertForm, LocalUserUpdateForm}, local_user_vote_display_mode::{LocalUserVoteDisplayMode, LocalUserVoteDisplayModeInsertForm}, }, @@ -201,6 +202,11 @@ impl Crud for LocalUser { .get_result::(conn) .await?; + // TODO: this is necessary for tests, but causes unnecessary db writes in production as languages + // are set from accept-language header immediately after. would be good if final languages + // could be passed in directly. + LocalUserLanguage::update(pool, vec![], local_user_.id).await?; + // Create their vote_display_modes let vote_display_mode_form = LocalUserVoteDisplayModeInsertForm::builder() .local_user_id(local_user_.id)