Explorar o código

Merge pull request #944 from ProgVal/patch-1

category_meta: Add support for Pelican >= 3.7.0
Justin Mayer %!s(int64=7) %!d(string=hai) anos
pai
achega
a96f3df350
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      category_meta/category_meta.py

+ 4 - 1
category_meta/category_meta.py

@@ -70,7 +70,10 @@ def make_category(article, slug):
 
     # Setting a category's name resets its slug, so do that first.
     category.name = article.title
-    category.slug = slug
+    try:
+        category.slug = slug
+    except AttributeError:
+        category._slug = slug
 
     # Description from article text.
     # XXX Relative URLs in the article content may not be handled correctly.