Skip to content

Commit

Permalink
fix: [#56] bio and avatar is user profile should be NULL for imported…
Browse files Browse the repository at this point in the history
… users
  • Loading branch information
josecelano committed Nov 30, 2022
1 parent 5d0def2 commit 0a58b6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,13 @@ impl SqliteDatabaseV2_0_0 {
user_id: i64,
username: &str,
email: &str,
email_verified: bool,
bio: &str,
avatar: &str,
email_verified: bool
) -> Result<i64, sqlx::Error> {
query("INSERT INTO torrust_user_profiles (user_id, username, email, email_verified, bio, avatar) VALUES (?, ?, ?, ?, ?, ?)")
.bind(user_id)
.bind(username)
.bind(email)
.bind(email_verified)
.bind(bio)
.bind(avatar)
.execute(&self.pool)
.await
.map(|v| v.last_insert_rowid())
Expand Down
7 changes: 1 addition & 6 deletions src/upgrades/from_v1_0_0_to_v2_0_0/upgrader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ async fn transfer_user_data(
);

let id = dest_database
.insert_imported_user(user.user_id, &date_imported, user.administrator)
.insert_imported_user(user.user_id, date_imported, user.administrator)
.await
.unwrap();

Expand All @@ -204,17 +204,12 @@ async fn transfer_user_data(
&user.username, &user.user_id
);

let default_user_bio = "".to_string();
let default_user_avatar = "".to_string();

dest_database
.insert_user_profile(
user.user_id,
&user.username,
&user.email,
user.email_verified,
&default_user_bio,
&default_user_avatar,
)
.await
.unwrap();
Expand Down

0 comments on commit 0a58b6c

Please sign in to comment.