Update red highlight check
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful

This commit is contained in:
Madis Mägi 2023-08-02 00:17:59 +03:00
parent ae54161c60
commit 71bb9694bc

View File

@ -51,14 +51,12 @@ from oidc import page_oidc, login_required, read_user
from api import page_api
def check_foreign_key_format(item):
try:
if type(item["inventory"]["owner"]["foreign_id"]) == ObjectId:
return True
if type(item["inventory"]["user"]["foreign_id"]) == ObjectId:
return True
except:
pass
return False
owner = item.get("inventory", {}).get("owner", {})
user = item.get("inventory", {}).get("user", {})
if owner.get("foreign_id", False):
return not bool(owner.get("username"))
if user.get("foreign_id", False):
return not bool(user.get("username"))
def render_markdown(text):
if not text: