Use CachedTicket.get_or_create to avoid duplicates

This commit is contained in:
Raphael Michel
2016-10-18 18:57:20 +02:00
parent 574f07877d
commit f3509707d7
4 changed files with 28 additions and 17 deletions

View File

@@ -304,7 +304,7 @@ class Order(LoggedModel):
class CachedTicket(models.Model):
order = models.ForeignKey(Order, on_delete=models.CASCADE)
cachedfile = models.ForeignKey(CachedFile, on_delete=models.CASCADE)
cachedfile = models.ForeignKey(CachedFile, on_delete=models.CASCADE, null=True)
provider = models.CharField(max_length=255)