Skip to content

Commit

Permalink
prepare d42
Browse files Browse the repository at this point in the history
  • Loading branch information
domdinicola committed Oct 25, 2023
1 parent 01866dc commit c2df5e2
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
9 changes: 4 additions & 5 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ django_find_project = true
DJANGO_SETTINGS_MODULE = aurora.config.settings
log_format = %(asctime)s %(levelname)s %(message)s
log_level = CRITICAL
python_paths = tests/extras src/
pythonpath = tests/extras src/
log_date_format = %Y-%m-%d %H:%M:%S
addopts =
--cov=aurora
Expand All @@ -24,7 +24,6 @@ markers =
admin:

python_files=test_*.py
filterwarnings =
ignore::DeprecationWarning
ignore::django.utils.deprecation.RemovedInDjango40Warning
ignore::django.utils.deprecation.RemovedInDjango41Warning
; filterwarnings =
; ignore::DeprecationWarning
; ignore::django.utils.deprecation.RemovedInDjango40Warning
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="results">
<table class="sysinfo-results">
<caption>
<a id="{{ name|lower }}"/>
<a name="{{ name|lower }}"/>
<h2>{{ name|title }}
<small>[<a href="#project">Project</a>
- <a href="#python">Python</a>
Expand Down
13 changes: 7 additions & 6 deletions src/aurora/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@

ROOT_URLCONF = "aurora.config.urls"

TEMPLATE_LOADERS = (
"dbtemplates.loader.Loader",
"django.template.loaders.filesystem.Loader",
"django.template.loaders.app_directories.Loader",
)

TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
Expand All @@ -132,11 +138,7 @@
],
"APP_DIRS": False,
"OPTIONS": {
"loaders": [
"dbtemplates.loader.Loader",
"django.template.loaders.filesystem.Loader",
"django.template.loaders.app_directories.Loader",
],
"loaders": TEMPLATE_LOADERS,
# 'builtins': [
# 'http2.templatetags',
# ],
Expand Down Expand Up @@ -554,7 +556,6 @@ def show_ddt(request): # pragma: no-cover
"debug_toolbar.panels.templates.TemplatesPanel",
"debug_toolbar.panels.cache.CachePanel",
"debug_toolbar.panels.signals.SignalsPanel",
"debug_toolbar.panels.logging.LoggingPanel",
"debug_toolbar.panels.redirects.RedirectsPanel",
"debug_toolbar.panels.profiling.ProfilingPanel",
]
Expand Down
2 changes: 1 addition & 1 deletion src/aurora/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def get_qrcode(content):
basewidth = 100
wpercent = basewidth / float(logo.size[0])
hsize = int((float(logo.size[1]) * float(wpercent)))
logo = logo.resize((basewidth, hsize), Image.ANTIALIAS)
logo = logo.resize((basewidth, hsize), Image.LANCZOS)
QRcode = qrcode.QRCode(error_correction=qrcode.constants.ERROR_CORRECT_H)
QRcode.add_data(content)
QRcode.make()
Expand Down
2 changes: 1 addition & 1 deletion src/aurora/ddt_panels.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from debug_toolbar.panels import Panel
from django.core.management import call_command
from django.template import Context, Template
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from aurora.state import state

Expand Down
6 changes: 3 additions & 3 deletions src/aurora/web/middlewares/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@


def is_admin_site(request):
parts = urlparse(request.get_raw_uri())
parts = urlparse(request.build_absolute_uri())
return re.compile(config.WAF_ADMIN_ALLOWED_HOSTNAMES).match(parts.netloc)


def is_public_site(request):
parts = urlparse(request.get_raw_uri())
parts = urlparse(request.build_absolute_uri())
return re.compile(config.WAF_REGISTRATION_ALLOWED_HOSTNAMES).match(parts.netloc)


Expand All @@ -29,7 +29,7 @@ def __call__(self, request):
if is_root(request) or request.user.is_staff:
return self.get_response(request)
else:
parts = urlparse(request.get_raw_uri())
parts = urlparse(request.build_absolute_uri())
try:
if parts.path.startswith(f"/{settings.DJANGO_ADMIN_URL}"):
if not is_admin_site(request):
Expand Down

0 comments on commit c2df5e2

Please sign in to comment.