Catalog.pdf_name() match what perl does - no season prefix

This commit is contained in:
2019-11-21 11:57:30 -08:00
parent 68b7f837ed
commit ae5e95a36a

View File

@ -75,7 +75,8 @@ class Catalog(models.Model):
def pdf_name(self):
pdf = "{}-{}-{}".format(self.season.id, self.name, self.id)
# NOTE: must match what the builder writes!
pdf = "{}-{}".format(self.name, self.id)
pdf = re.sub(r'\s+', r'_', pdf)
pdf = re.sub(r'[^\w\-]', r'', pdf)
pdf += '.pdf'