Fix invalid query for settings and users
This commit is contained in:
@@ -108,6 +108,7 @@ impl PasswordStrategy {
|
||||
.to_string();
|
||||
|
||||
let new_identity = user_identity::ActiveModel {
|
||||
id: sea_orm::ActiveValue::Set(Uuid::new_v4()),
|
||||
user_id: sea_orm::ActiveValue::Set(user_id),
|
||||
provider: sea_orm::ActiveValue::Set(PASSWORD_PROVIDER.to_string()),
|
||||
password_hash: sea_orm::ActiveValue::Set(Some(password_hash)),
|
||||
|
||||
@@ -163,7 +163,7 @@ impl UserService for UserServiceImpl {
|
||||
tx: Option<&mut DatabaseTransaction>,
|
||||
) -> Result<User, ServiceError> {
|
||||
let user_active_model = UserActiveModel {
|
||||
id: ActiveValue::NotSet,
|
||||
id: ActiveValue::Set(Uuid::new_v4()),
|
||||
name: ActiveValue::Set(user.username),
|
||||
is_admin: ActiveValue::Set(user.is_admin),
|
||||
is_active: ActiveValue::Set(true),
|
||||
|
||||
@@ -77,10 +77,11 @@ impl SettingsStore for SettingsService {
|
||||
Ok(None) => {
|
||||
handle_not_found(key.to_string(), value).await?;
|
||||
}
|
||||
Ok(Some(mut record)) => {
|
||||
record.value = value;
|
||||
record
|
||||
.into_active_model()
|
||||
Ok(Some(record)) => {
|
||||
let mut record_active_model = record.into_active_model();
|
||||
record_active_model.value = ActiveValue::Set(value);
|
||||
record_active_model.updated_at = ActiveValue::Set(chrono::Utc::now());
|
||||
record_active_model
|
||||
.update(&*self.connection)
|
||||
.await
|
||||
.map_err(ServiceError::from)?;
|
||||
|
||||
Reference in New Issue
Block a user