Make it possible to choose an avatar

This commit is contained in:
Bat
2018-09-03 13:04:17 +01:00
parent 95ba99a6be
commit e2e7d10929
3 changed files with 15 additions and 1 deletions
+7
View File
@@ -491,6 +491,13 @@ impl User {
}
})
}
pub fn set_avatar(&self, conn: &PgConnection, id: i32) {
diesel::update(self)
.set(users::avatar_id.eq(id))
.execute(conn)
.expect("Couldn't update user avatar");
}
}
impl<'a, 'r> FromRequest<'a, 'r> for User {