We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit daa9749f authored by Daniel Watkins's avatar Daniel Watkins

Track slugs aren't globally unique, just within albums.

parent 35f4a1be
......@@ -103,7 +103,7 @@ class Track(models.Model):
length = models.PositiveSmallIntegerField(blank=True)
album = models.ForeignKey(Album, null=True)
mbid = models.CharField(max_length=256, blank=True)
slug = models.SlugField(unique=True, editable=False)
slug = models.SlugField(editable=False)
def get_absolute_url(self):
return "%s%s/" % (self.album.get_absolute_url(), self.name)
......@@ -115,6 +115,9 @@ class Track(models.Model):
def __unicode__(self):
return "%s - %s" % (self.album.artist, self.name)
class Meta:
unique_together = ('album', 'slug')
class Session(models.Model):
user = models.OneToOneField(GobblerUser, primary_key=True)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment