fixed edit bug
This commit is contained in:
parent
8bde2ab5f3
commit
1baf73a338
|
@ -76,6 +76,12 @@ ul.nav li {
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#character_sheet input#name {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
font-weight: bold;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.stats .cards {
|
.stats .cards {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
display: grid;
|
display: grid;
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<div class='banner'>
|
<div class='banner'>
|
||||||
<div><img id='portrait' /></div>
|
<div><img id='portrait' /></div>
|
||||||
<div>
|
<div>
|
||||||
<h1>{{ c.form.name }}</h1>
|
{{ c.form.name }}
|
||||||
{{ c.form.ancestry }} {{ c.record.character_class|join(' / ') }} Level {{ c.form.level }}
|
{{ c.form.ancestry }} {{ c.record.character_class|join(' / ') }} Level {{ c.form.level }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -102,12 +102,12 @@ class BaseController:
|
||||||
previous = dict(self.record)
|
previous = dict(self.record)
|
||||||
self.form.populate_obj(self.record)
|
self.form.populate_obj(self.record)
|
||||||
transaction_log.record(previous, self.record)
|
transaction_log.record(previous, self.record)
|
||||||
if self.record.id:
|
|
||||||
return
|
|
||||||
with db.transaction():
|
with db.transaction():
|
||||||
db.add(self.record)
|
db.add(self.record)
|
||||||
logging.debug(f"Added {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)
|
return HTTPFound(location=location)
|
||||||
|
|
||||||
def delete(self):
|
def delete(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user