From 1baf73a338f81b1bea95c9aefb3c5b0ce2e7a5f0 Mon Sep 17 00:00:00 2001 From: evilchili Date: Thu, 8 Feb 2024 23:26:19 -0800 Subject: [PATCH] fixed edit bug --- ttfrog/assets/static/css/styles.css | 6 ++++++ ttfrog/assets/templates/character_sheet.html | 2 +- ttfrog/webserver/controllers/base.py | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ttfrog/assets/static/css/styles.css b/ttfrog/assets/static/css/styles.css index 208afc0..b557066 100644 --- a/ttfrog/assets/static/css/styles.css +++ b/ttfrog/assets/static/css/styles.css @@ -76,6 +76,12 @@ ul.nav li { border: 0; } +#character_sheet input#name { + font-size: 1.5rem; + font-weight: bold; + width: 100%; +} + .stats .cards { margin-top: 1rem; display: grid; diff --git a/ttfrog/assets/templates/character_sheet.html b/ttfrog/assets/templates/character_sheet.html index 15e4990..bff7e89 100644 --- a/ttfrog/assets/templates/character_sheet.html +++ b/ttfrog/assets/templates/character_sheet.html @@ -11,7 +11,7 @@ diff --git a/ttfrog/webserver/controllers/base.py b/ttfrog/webserver/controllers/base.py index d142e6b..0eac46a 100644 --- a/ttfrog/webserver/controllers/base.py +++ b/ttfrog/webserver/controllers/base.py @@ -102,12 +102,12 @@ class BaseController: previous = dict(self.record) self.form.populate_obj(self.record) transaction_log.record(previous, self.record) - if self.record.id: - return with db.transaction(): db.add(self.record) logging.debug(f"Added {self.record = }") - location = f"{self.request.current_route_path()}/{self.record.uri}" + location = self.request.current_route_path() + if self.slug not in location: + location = f"{location}/{self.record.uri}" return HTTPFound(location=location) def delete(self):