fix langs

This commit is contained in:
Felix Ableitner 2024-03-25 12:00:47 +01:00
parent 47105a9c3d
commit f9d6384e7a

View file

@ -2,6 +2,7 @@ use crate::{
newtypes::{DbUrl, LocalUserId, PersonId}, newtypes::{DbUrl, LocalUserId, PersonId},
schema::{local_user, person, registration_application}, schema::{local_user, person, registration_application},
source::{ source::{
actor_language::LocalUserLanguage,
local_user::{LocalUser, LocalUserInsertForm, LocalUserUpdateForm}, local_user::{LocalUser, LocalUserInsertForm, LocalUserUpdateForm},
local_user_vote_display_mode::{LocalUserVoteDisplayMode, LocalUserVoteDisplayModeInsertForm}, local_user_vote_display_mode::{LocalUserVoteDisplayMode, LocalUserVoteDisplayModeInsertForm},
}, },
@ -201,6 +202,11 @@ impl Crud for LocalUser {
.get_result::<Self>(conn) .get_result::<Self>(conn)
.await?; .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 // Create their vote_display_modes
let vote_display_mode_form = LocalUserVoteDisplayModeInsertForm::builder() let vote_display_mode_form = LocalUserVoteDisplayModeInsertForm::builder()
.local_user_id(local_user_.id) .local_user_id(local_user_.id)