From ae360114069da9ef567551dede7196d7831049c1 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 22 Oct 2024 11:31:03 +0300 Subject: backend: importance of || and && --- backend/handlers/record.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/handlers/record.go b/backend/handlers/record.go index c720823..e43cc61 100644 --- a/backend/handlers/record.go +++ b/backend/handlers/record.go @@ -204,7 +204,7 @@ func CreateRecordWithDemo(c *gin.Context) { // c.JSON(http.StatusOK, models.ErrorResponse(fmt.Sprintf("Partner SteamID from demo and request does not match! Check your submission and try again.\nDemo Partner SteamID: %s\nRequest Partner SteamID: %s", convertedPartnerSteamID, record.PartnerID))) // return // } - if convertedHostSteamID != user.(models.User).SteamID || convertedPartnerSteamID != user.(models.User).SteamID { + if convertedHostSteamID != user.(models.User).SteamID && convertedPartnerSteamID != user.(models.User).SteamID { deleteFile(srv, hostDemoFileID) deleteFile(srv, partnerDemoFileID) c.JSON(http.StatusOK, models.ErrorResponse("You are permitted to only upload your own runs!")) -- cgit v1.2.3