mirror of
https://git.ugnet.gay/CrossTalk/azul.git
synced 2026-11-25 08:40:05 +00:00
bug fixes and improvements
- aliases are now handled properly in ABCH - removed final escargot leftovers (dev webconsole) - OSCAR etc. logging was not at log level debug - removed leftover debug code
This commit is contained in:
1 parent
4bf878556b
commit
6451bb9426
46 files changed
+307
-541
No files matched your search
+16
-1
@@ -11,7 +11,11 @@ def render(req: web.Request, tmpl_name: str, ctxt: Optional[Dict[str, Any]] = No
|
||||
else:
|
||||
content_type = 'text/html'
|
||||
tmpl = req.app['jinja_env'].get_template(tmpl_name)
|
||||
content = tmpl.render(**(ctxt or {}))
|
||||
template_context = dict(ctxt or {})
|
||||
backend = req.app.get('backend')
|
||||
if backend is not None:
|
||||
template_context['display_email'] = display_email
|
||||
content = tmpl.render(**template_context)
|
||||
return web.Response(status = status, content_type = content_type, text = content)
|
||||
|
||||
async def preprocess_soap(req: web.Request) -> Tuple[Any, Any, Optional[BackendSession], str]:
|
||||
@@ -151,6 +155,17 @@ def parse_cookies(cookie_string: Optional[str]) -> Dict[str, Any]:
|
||||
|
||||
return cookie_dict
|
||||
|
||||
def display_email(user: Any, fallback: Optional[str] = None) -> str:
|
||||
if isinstance(user, str):
|
||||
user = backend.user_service.get(user)
|
||||
if user is None and fallback:
|
||||
uuid = backend.user_service.get_uuid(fallback)
|
||||
if uuid is not None:
|
||||
user = backend.user_service.get(uuid)
|
||||
if user is None:
|
||||
return fallback or ''
|
||||
return backend.util_get_display_email(user)
|
||||
|
||||
async def dispatch_abch(req: web.Request, module: Any, prefix: str) -> web.Response:
|
||||
header, action, bs, _ = await preprocess_soap(req)
|
||||
if bs is None:
|
||||
|
||||
Reference in new issue
Block a user