Scan files with clamdscan #77
@ -1,7 +1,6 @@
|
|||||||
from urllib.parse import urljoin, urlparse
|
from urllib.parse import urljoin, urlparse
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.sites.shortcuts import get_current_site
|
from django.contrib.sites.shortcuts import get_current_site
|
||||||
@ -41,31 +40,6 @@ def absolute_url(context, path: str) -> str:
|
|||||||
return absolutify(path, request=request)
|
return absolutify(path, request=request)
|
||||||
|
|
||||||
|
|
||||||
# A (temporary?) copy of this is in services/utils.py. See bug 1055654.
|
|
||||||
def user_media_path(what):
|
|
||||||
"""Make it possible to override storage paths in settings.
|
|
||||||
|
|
||||||
By default, all storage paths are in the MEDIA_ROOT.
|
|
||||||
|
|
||||||
This is backwards compatible.
|
|
||||||
|
|
||||||
"""
|
|
||||||
default = os.path.join(settings.MEDIA_ROOT, what)
|
|
||||||
key = f'{what.upper()}_PATH'
|
|
||||||
return getattr(settings, key, default)
|
|
||||||
|
|
||||||
|
|
||||||
# A (temporary?) copy of this is in services/utils.py. See bug 1055654.
|
|
||||||
def user_media_url(what):
|
|
||||||
"""
|
|
||||||
Generate default media url, and make possible to override it from
|
|
||||||
settings.
|
|
||||||
"""
|
|
||||||
default = f'{settings.MEDIA_URL}{what}/'
|
|
||||||
key = '{}_URL'.format(what.upper().replace('-', '_'))
|
|
||||||
return getattr(settings, key, default)
|
|
||||||
|
|
||||||
|
|
||||||
class PaginationRenderer:
|
class PaginationRenderer:
|
||||||
def __init__(self, pager):
|
def __init__(self, pager):
|
||||||
self.pager = pager
|
self.pager = pager
|
||||||
|
Loading…
Reference in New Issue
Block a user