Use proper path converter for lemonshort
This commit is contained in:
parent
cfeb206154
commit
683adc1b46
5 changed files with 20 additions and 14 deletions
|
|
@ -2,7 +2,7 @@ from django.apps import apps
|
|||
from django.conf import settings
|
||||
from typing import Any, Dict, Type
|
||||
|
||||
from .convert import id_to_abc
|
||||
from .convert import AbcIdConverter
|
||||
|
||||
prefixes = {} # type: Dict[Type[Any], str]
|
||||
|
||||
|
|
@ -14,4 +14,4 @@ def short_url(entity):
|
|||
base = '/'
|
||||
if hasattr(settings, 'SHORT_BASE_URL'):
|
||||
base = settings.SHORT_BASE_URL
|
||||
return base + prefixes[type(entity)] + id_to_abc(entity.id)
|
||||
return base + prefixes[type(entity)] + AbcIdConverter().to_url(entity.id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue