aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2023-03-25 17:53:02 +0100
committerDaniel Schadt <kingdread@gmx.de>2023-03-31 19:38:45 +0200
commit809a2416c93318ec2061d6dc49b662bd8abf1c46 (patch)
treef10ff3fd1a1daffe80e6a0c32d8be1372cf41092
parentc8520a5501fc6a472345446597037b4f00687259 (diff)
downloadfietsboek-809a2416c93318ec2061d6dc49b662bd8abf1c46.tar.gz
fietsboek-809a2416c93318ec2061d6dc49b662bd8abf1c46.tar.bz2
fietsboek-809a2416c93318ec2061d6dc49b662bd8abf1c46.zip
insert user into hittekaart queue on track uploads
-rw-r--r--fietsboek/scripts/fietscron.py2
-rw-r--r--fietsboek/views/detail.py4
-rw-r--r--fietsboek/views/upload.py3
3 files changed, 8 insertions, 1 deletions
diff --git a/fietsboek/scripts/fietscron.py b/fietsboek/scripts/fietscron.py
index e422fb2..897078c 100644
--- a/fietsboek/scripts/fietscron.py
+++ b/fietsboek/scripts/fietscron.py
@@ -142,7 +142,7 @@ def refill_queue(session: Session, redis: Redis):
"""Refills the low-priority hittekaart queue by adding all users to it."""
LOGGER.debug("Refilling low-priority queue")
for user in session.execute(select(models.User)).scalars():
- redis.sadd("hittekaart:queue:low", str(user.id))
+ redis.sadd("hittekaart:queue:low", user.id)
__all__ = ["cli"]
diff --git a/fietsboek/views/detail.py b/fietsboek/views/detail.py
index 259e5d6..f540a11 100644
--- a/fietsboek/views/detail.py
+++ b/fietsboek/views/detail.py
@@ -138,6 +138,10 @@ def delete_track(request):
request.dbsession.delete(track)
request.data_manager.purge(track_id)
request.session.flash(request.localizer.translate(_("flash.track_deleted")))
+
+ if request.config.hittekaart_autogenerate:
+ request.redis.sadd("hittekaart:queue:high", request.identity.id)
+
return HTTPFound(request.route_url("home"))
diff --git a/fietsboek/views/upload.py b/fietsboek/views/upload.py
index fd93034..6fccdba 100644
--- a/fietsboek/views/upload.py
+++ b/fietsboek/views/upload.py
@@ -187,6 +187,9 @@ def do_finish_upload(request):
request.session.flash(request.localizer.translate(_("flash.upload_success")))
+ if request.config.hittekaart_autogenerate:
+ request.redis.sadd("hittekaart:queue:high", request.identity.id)
+
return HTTPFound(request.route_url("details", track_id=track.id))