fixed potential duplicate key value bug with Newsletter

This commit is contained in:
Mia Rose Winter 2024-02-18 12:49:43 +01:00
parent 2ccfe15199
commit 3b643a1421
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E

View file

@ -189,7 +189,7 @@
Article = Article,
DistributionDateTime = Article.PublishDate
};
context.Add(newsletter);
await context.Set<EmailNewsletter>().AddAsync(newsletter);
await context.SaveChangesAsync();
} catch (Exception ex) {
Logger.LogError(ex, "Failed to schedule article {name} for E-Mail distribution.", Article.Title);