Skip to content

Commit 2468eab

Browse files
committed
Make crate_owners.updated_at private in DB dump
Also don't use filter_map in inserts for the sake of simplicity.
1 parent 6d94155 commit 2468eab

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

src/controllers/user/me.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -260,20 +260,15 @@ pub fn update_email_notifications(req: &mut dyn Request) -> CargoResult<Response
260260
.load(&*conn)?
261261
.into_iter()
262262
// Remove records whose `email_notifications` will not change from their current value
263-
.filter_map(
263+
.map(
264264
|(c_id, o_id, o_kind, e_notifications): (i32, i32, i32, bool)| {
265265
let current_e_notifications = *updates.get(&c_id).unwrap_or(&e_notifications);
266-
267-
if e_notifications == current_e_notifications {
268-
None
269-
} else {
270-
Some((
271-
crate_id.eq(c_id),
272-
owner_id.eq(o_id),
273-
owner_kind.eq(o_kind),
274-
email_notifications.eq(current_e_notifications),
275-
))
276-
}
266+
(
267+
crate_id.eq(c_id),
268+
owner_id.eq(o_id),
269+
owner_kind.eq(o_kind),
270+
email_notifications.eq(current_e_notifications),
271+
)
277272
},
278273
)
279274
.collect::<Vec<_>>();

src/tasks/dump_db/dump-db.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ owner_id = "public"
6666
created_at = "public"
6767
created_by = "private"
6868
deleted = "private"
69-
updated_at = "public"
69+
updated_at = "private"
7070
owner_kind = "public"
7171
email_notifications = "private"
7272

0 commit comments

Comments
 (0)