diff options
author | John Turner <jturner.usa@gmail.com> | 2025-09-10 00:20:31 -0400 |
---|---|---|
committer | John Turner <jturner.usa@gmail.com> | 2025-09-10 00:20:31 -0400 |
commit | 998bf36dfd1b513011e84b430fa69dbfac926689 (patch) | |
tree | 79b22884c85e1380ed6de3083ee0a776e2d460ce | |
parent | 2ba89f3528d3cd07a72bf1d1f80556d95aa83016 (diff) | |
download | pypaste-998bf36dfd1b513011e84b430fa69dbfac926689.tar.gz |
remember the syntax value if it was set during upload
-rw-r--r-- | pypaste/__init__.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pypaste/__init__.py b/pypaste/__init__.py index b255056..29f7fad 100644 --- a/pypaste/__init__.py +++ b/pypaste/__init__.py @@ -164,12 +164,14 @@ class App: log_info(f"{key} does not exist, returning 404") return web.HTTPNotFound() - syntax = request.query.get("syntax") - raw = request.query.get("raw") + if (syntax := paste.syntax) is None: + syntax = request.query.get("syntax") if (style := request.query.get("style")) is None: style = self.config.default_style + raw = request.query.get("raw") + if raw is not None: log_info(f"sending raw paste {key}") |