fix a bug appearing only in Docker container
This commit is contained in:
parent
dd01bd1be4
commit
31a70671ee
2 changed files with 12 additions and 2 deletions
|
|
@ -9,7 +9,7 @@ from quart import render_template, session
|
|||
from quart import abort, Blueprint, redirect, request, url_for
|
||||
from pydantic import BaseModel, Field
|
||||
from quart_auth import current_user, login_required, login_user, logout_user
|
||||
from quart_schema import validate_request, validate_response
|
||||
from quart_schema import validate_request
|
||||
from quart_wtf.csrf import generate_csrf
|
||||
from sqlalchemy import delete, insert, select
|
||||
from suou import Snowflake, deprecated, makelist, not_implemented, want_isodate
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@ from quart_auth import current_user
|
|||
from markupsafe import Markup
|
||||
from sqlalchemy import insert, select, update
|
||||
from suou import additem, not_implemented
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
from freak import UserLoader
|
||||
from freak.utils import get_request_form
|
||||
|
|
@ -159,7 +162,14 @@ async def homepage():
|
|||
|
||||
@bp.route('/admin/style.css')
|
||||
async def style_css():
|
||||
return await send_from_directory(os.path.dirname(os.path.dirname(__file__)) + '/static/css', 'style.css')
|
||||
css_dir = os.path.dirname(os.path.dirname(__file__)) + '/static/css'
|
||||
try:
|
||||
return await send_from_directory(css_dir, 'style.css')
|
||||
except Exception as e:
|
||||
# Docker
|
||||
logger.error(e)
|
||||
with open(os.path.join(css_dir, 'style.css')) as f:
|
||||
return f.read(), {"content-type": "text/css"}
|
||||
|
||||
@bp.route('/admin/reports/')
|
||||
@admin_required
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue