aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2022-07-02 21:35:04 +0200
committerDaniel Schadt <kingdread@gmx.de>2022-07-02 21:36:25 +0200
commitb0ec6ad83681ae7825900fe291de0f157a623574 (patch)
tree76d0dfb422958a6e49c607b33b01236fb3c1fa7e
parent1b0f60125e304790322443dcee94ca9eba6999e4 (diff)
downloadfietsboek-b0ec6ad83681ae7825900fe291de0f157a623574.tar.gz
fietsboek-b0ec6ad83681ae7825900fe291de0f157a623574.tar.bz2
fietsboek-b0ec6ad83681ae7825900fe291de0f157a623574.zip
ensure the track cache is built after upload
-rw-r--r--fietsboek/views/upload.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/fietsboek/views/upload.py b/fietsboek/views/upload.py
index debd248..f670d52 100644
--- a/fietsboek/views/upload.py
+++ b/fietsboek/views/upload.py
@@ -162,6 +162,10 @@ def do_finish_upload(request):
request.dbsession.delete(upload)
request.dbsession.flush()
+ # Best time to build the cache is right after the upload
+ track.ensure_cache()
+ request.dbsession.add(track.cache)
+
request.session.flash(request.localizer.translate(_("flash.upload_success")))
return HTTPFound(request.route_url('details', id=track.id))