From dfefd0208ceb65b32f0449327d0868a69e5fa41f Mon Sep 17 00:00:00 2001 From: cclohmar Date: Tue, 14 Jul 2026 11:24:24 +0000 Subject: [PATCH] fix: allow editing expenses in pre-migration events (empty month_id) --- internal/handlers/helpers.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/handlers/helpers.go b/internal/handlers/helpers.go index e58071d..2aafeb7 100644 --- a/internal/handlers/helpers.go +++ b/internal/handlers/helpers.go @@ -15,10 +15,11 @@ func normalizeImagePath(path string) string { } // verifyMonthOwnership checks that a month exists and belongs to the given user. -// Returns true if the month is owned by the user, false otherwise. +// If monthID is empty (pre-migration events), returns true since event ownership +// was already verified by the caller. func verifyMonthOwnership(db *sql.DB, monthID, userID string) bool { if monthID == "" { - return false + return true } month, err := database.GetMonthByID(db, monthID) if err != nil || month == nil {