From: Philipp Spitzer Date: Mon, 11 Jul 2022 20:03:27 +0000 (+0200) Subject: Prevent empty sled rental with comment. X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/wrpylib.git/commitdiff_plain/94cb2a963f4f9add041e41bcc3a90c5bdd12ab46 Prevent empty sled rental with comment. --- diff --git a/wrpylib/wrmwmarkup.py b/wrpylib/wrmwmarkup.py index 68b9277..547c2e1 100644 --- a/wrpylib/wrmwmarkup.py +++ b/wrpylib/wrmwmarkup.py @@ -440,9 +440,13 @@ def create_sledrun_wiki(sledrun_json: Dict, map_json: Optional[Dict], impression n = x.get('name') c = x.get('note') p = x.get('wr_page') + link = x.get('weblink') if p is not None: n = Jinja2Tools().json_wr_page(p) - w.append((n, c)) + if n is None and link is not None: + n = link.get('text') + if n is not None: + w.append((n, c)) return w def cachet() -> Optional[List]: