feat: new reports scheduler (#11711)

* feat(reports): scheduler and delivery system

* working version

* improvements and fix grace_period

* add tests and fix bugs

* fix report API test

* test MySQL test fail

* delete-orphans

* fix MySQL tests

* address comments

* lint
This commit is contained in:
Daniel Vaz Gaspar
2020-11-25 08:50:30 +00:00
committed by GitHub
parent 501b9d47c5
commit f27ebc4be5
19 changed files with 1499 additions and 59 deletions

View File

@@ -20,11 +20,15 @@ from typing import Any
from flask import current_app, url_for
def headless_url(path: str) -> str:
base_url = current_app.config.get("WEBDRIVER_BASEURL", "")
def headless_url(path: str, user_friendly: bool = False) -> str:
base_url = (
current_app.config["WEBDRIVER_BASEURL_USER_FRIENDLY"]
if user_friendly
else current_app.config["WEBDRIVER_BASEURL"]
)
return urllib.parse.urljoin(base_url, path)
def get_url_path(view: str, **kwargs: Any) -> str:
def get_url_path(view: str, user_friendly: bool = False, **kwargs: Any) -> str:
with current_app.test_request_context():
return headless_url(url_for(view, **kwargs))
return headless_url(url_for(view, **kwargs), user_friendly=user_friendly)