Skip to content

Commit f0d2010

Browse files
committed
🔥 Remove unused code
build_absolute_url and get_domain were used by the previous implementation of django-setup-configuration, but no longer used after the refactor
1 parent 9cef6b4 commit f0d2010

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

src/objecttypes/utils/__init__.py

-29
Original file line numberDiff line numberDiff line change
@@ -1,29 +0,0 @@
1-
from django.conf import settings
2-
from django.http import HttpRequest
3-
4-
from furl import furl
5-
6-
7-
def get_domain() -> str:
8-
"""
9-
Obtain the domain/netloc according to settings or configuration.
10-
"""
11-
from django.contrib.sites.models import Site
12-
13-
if settings.OBJECTTYPES_DOMAIN:
14-
return settings.OBJECTTYPES_DOMAIN
15-
16-
return Site.objects.get_current().domain
17-
18-
19-
def build_absolute_url(path: str, request: HttpRequest | None = None) -> str:
20-
if request is not None:
21-
return request.build_absolute_uri(path)
22-
23-
domain = get_domain()
24-
_furl = furl(
25-
scheme="https" if settings.IS_HTTPS else "http",
26-
netloc=domain,
27-
path=path,
28-
)
29-
return _furl.url

0 commit comments

Comments
 (0)