Skip to content

Commit 949d294

Browse files
committed
Remove a comment that's no longer applicable
Because we're only storing the user ID in the extensions rather than the whole `User`, we're always looking up the user in the database, so this comment saying the user lookup isn't preferable is out of date.
1 parent 30f8dff commit 949d294

File tree

1 file changed

+0
-11
lines changed
  • src/controllers/user

1 file changed

+0
-11
lines changed

src/controllers/user/me.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,6 @@ use crate::views::{EncodableMe, EncodableVersion, OwnedCrate};
1313

1414
/// Handles the `GET /me` route.
1515
pub fn me(req: &mut dyn Request) -> AppResult<Response> {
16-
// Changed to getting User information from database because in
17-
// src/tests/user.rs, when testing put and get on updating email,
18-
// request seems to be somehow 'cached'. When we try to get a
19-
// request from the /me route with the just updated user (call
20-
// this function) the user is the same as the initial GET request
21-
// and does not seem to get the updated user information from the
22-
// database
23-
// This change is not preferable, we'd rather fix the request,
24-
// perhaps adding `req.mut_extensions().insert(user)` to the
25-
// update_user route, however this somehow does not seem to work
26-
2716
let conn = req.db_conn()?;
2817
let user_id = req.authenticate(&conn)?.user_id();
2918

0 commit comments

Comments
 (0)