Browse Source

Slugify style slug in StyleMixin

master 0.3.9
Erik Stein 7 years ago
parent
commit
15274f9d70
  1. 3
      CHANGES
  2. 5
      content_plugins/plugins/mixins.py

3
CHANGES

@ -1,3 +1,6 @@
0.3.9 2018-09-20
- Slugify style slug in StyleMixin
0.3.8 2018-09-14
- SectionBase: use downgrading slug field

5
content_plugins/plugins/mixins.py

@ -3,6 +3,8 @@ import os
from django.db import models
from django.utils.translation import ugettext_lazy as _
from shared.utils.text import slugify
class StyleField(models.CharField):
"""
@ -23,7 +25,8 @@ class StyleMixin(models.Model):
abstract = True
def get_style_slug(self):
return getattr(self, 'style', None) or 'default'
style = getattr(self, 'style', None) or 'default'
return slugify(style).replace("_", "-")
# # Compatibiliy with super classes not having a prefixed_path method
# def prefixed_path(self, path):

Loading…
Cancel
Save