diff options
author | Helmut Grohne <helmut@subdivi.de> | 2019-03-05 21:27:03 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2019-03-05 21:27:03 +0100 |
commit | a5b445c9067c598b54818db70ff76eab802b8a2a (patch) | |
tree | e9a40d76370951c9ffa2c277547fdf568550d522 | |
parent | 6a1f177ffac999d9069c6158ae820d1c4a25ffc2 (diff) | |
download | crossqa-a5b445c9067c598b54818db70ff76eab802b8a2a.tar.gz |
webapp: jinja 2.8 doesn't support dotted assignments
-rw-r--r-- | webapp.py | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -30,12 +30,8 @@ src_template = """<!DOCTYPE html> <th>state</th> <th>architectures</th> </tr> - {%- set bootstrapdn = namespace(show=False) -%} {%- set okarchs = depresult.pop(None, None) -%} {%- for reason, archs in depresult.items()|sort -%} - {%- if not reason.startswith("skew ") -%} - {%- set bootstrapdn.show = True -%} - {%- endif -%} <tr> <td>{{ reason|e }}</td> <td>{{ archs|arch_format }}</td> @@ -50,7 +46,7 @@ src_template = """<!DOCTYPE html> </table> <h5>See also</h5> <ul> - {%- if bootstrapdn.show -%} + {%- if show_bootstrapdn -%} <li> <a href="https://bootstrap.debian.net/cross_all/{{ sourcepackage|e }}.html">bootstrap.debian.net</a> </li> @@ -146,6 +142,9 @@ def show_source(source): SELECT version, architecture, success, starttime, filename FROM builds WHERE source = :source;""") context["builds"] = list(conn.execute(query, source=source)) + context["show_bootstrapdn"] = \ + any(reason and not reason.startswith("skew ") + for reason in context["depresult"].keys()) return flask.render_template_string(src_template, **context) @app.route("/build/<path:filename>") |