Use proper path converter for lemonshort

This commit is contained in:
Danielle McLean 2022-03-12 15:04:05 +11:00
parent cfeb206154
commit 683adc1b46
5 changed files with 20 additions and 14 deletions

View file

@ -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)