Merge branch 'dev' of gitea.planet-casio.com:devs/PCv5 into dev

This commit is contained in:
Eragon 2019-12-03 23:16:07 +01:00
commit dac218b3b9
No known key found for this signature in database
GPG Key ID: 41F8C3FE5948FDAB
2 changed files with 3 additions and 1 deletions

View File

@ -16,4 +16,5 @@ python-ldap
python-uwsgi
python-psycopg2
python-pyyaml
python-slugify
```

View File

@ -19,6 +19,7 @@ For more information, see the Werkzeug documentation:
from werkzeug.routing import BaseConverter, ValidationError
from app.models.forum import Forum
from app.models.topic import Topic
from slugify import slugify
import re
import sys
@ -52,7 +53,7 @@ class TopicSlugConverter(BaseConverter):
return Topic.query.get_or_404(int(m[1], 10))
def to_url(self, topic):
return str(topic.id)
return f'{topic.id}-{slugify(topic.title)}'
# Export only the converter classes
__all__ = "ForumConverter TopicSlugConverter".split()