Skip to content

Commit f26e98b

Browse files
Turbo87LawnGnome
andauthored
Update src/controllers/krate/delete.rs
Co-authored-by: Adam Harvey <[email protected]>
1 parent a666f2e commit f26e98b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/controllers/krate/delete.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ pub async fn delete(Path(name): Path<String>, parts: Parts, app: AppState) -> Ap
5252

5353
let created_at = krate.created_at.and_utc();
5454

55-
let is_new = created_at > Utc::now() - chrono::Duration::hours(72);
56-
if !is_new {
55+
let is_old = created_at <= Utc::now() - chrono::Duration::hours(72);
56+
if is_old {
5757
if owners.len() > 1 {
5858
let msg = "only crates with a single owner can be deleted after 72 hours";
5959
return Err(custom(StatusCode::UNPROCESSABLE_ENTITY, msg));

0 commit comments

Comments
 (0)