diff --git a/db/postgres/mod.go b/db/postgres/mod.go index 438ada7..9c4fcf9 100644 --- a/db/postgres/mod.go +++ b/db/postgres/mod.go @@ -260,7 +260,7 @@ func NewModQuery(ctx context.Context, filter *models.ModFilter, unapproved bool, } } - return query.Debug() + return query } func GetModByIDOrReference(ctx context.Context, modIDOrReference string) *Mod { diff --git a/redis/jobs/consumers/consumer_scan_mod_on_virus_total.go b/redis/jobs/consumers/consumer_scan_mod_on_virus_total.go index 32ca821..c906f8c 100644 --- a/redis/jobs/consumers/consumer_scan_mod_on_virus_total.go +++ b/redis/jobs/consumers/consumer_scan_mod_on_virus_total.go @@ -38,6 +38,12 @@ func ScanModOnVirusTotalConsumer(ctx context.Context, payload []byte) error { log.Info().Msgf("starting virus scan of mod %s version %s", task.ModID, task.VersionID) version := postgres.GetVersion(ctx, task.VersionID) + // Version got deleted? + if version == nil { + log.Error().Msgf("mod %s version %s does not exist to be scanned", task.ModID, task.VersionID) + return nil + } + link := storage.GenerateDownloadLink(version.Key) response, _ := http.Get(link) diff --git a/schemas/bootstrap_version.graphql b/schemas/bootstrap_version.graphql index fa6c24e..be3c4f4 100755 --- a/schemas/bootstrap_version.graphql +++ b/schemas/bootstrap_version.graphql @@ -67,7 +67,7 @@ extend type Query { ### Mutations extend type Mutation { - createBootstrapVersion(bootstrapVersion: NewBootstrapVersion!): BootstrapVersion @isLoggedIn + createBootstrapVersion(bootstrapVersion: NewBootstrapVersion!): BootstrapVersion @canEditBootstrapVersions @isLoggedIn updateBootstrapVersion(bootstrapVersionId: BootstrapVersionID!, bootstrapVersion: UpdateBootstrapVersion!): BootstrapVersion! @canEditBootstrapVersions @isLoggedIn deleteBootstrapVersion(bootstrapVersionId: BootstrapVersionID!): Boolean! @canEditBootstrapVersions @isLoggedIn } diff --git a/schemas/sml_version.graphql b/schemas/sml_version.graphql index 9299c3f..4a3b5b3 100755 --- a/schemas/sml_version.graphql +++ b/schemas/sml_version.graphql @@ -92,7 +92,7 @@ extend type Query { ### Mutations extend type Mutation { - createSMLVersion(smlVersion: NewSMLVersion!): SMLVersion @isLoggedIn + createSMLVersion(smlVersion: NewSMLVersion!): SMLVersion @canEditSMLVersions @isLoggedIn updateSMLVersion(smlVersionId: SMLVersionID!, smlVersion: UpdateSMLVersion!): SMLVersion! @canEditSMLVersions @isLoggedIn deleteSMLVersion(smlVersionId: SMLVersionID!): Boolean! @canEditSMLVersions @isLoggedIn }