diff --git a/alert/main.py b/alert/main.py index d56a357..6dad3a2 100644 --- a/alert/main.py +++ b/alert/main.py @@ -31,7 +31,11 @@ class FlatAlerter: self.last_response_hash = "" def _flat_payload(self, flat: Flat) -> dict: - c = flat.connectivity + # Transit-connectivity is disabled to save Google-Maps quota. The + # helper on Flat (flat.connectivity → Maps.calculate_score) is + # intentionally kept so it can be re-enabled without re-writing code — + # just replace the empty dict with `flat.connectivity` when needed. + c: dict = {} lat, lng = flat.coords return { "id": flat.id, diff --git a/web/app.py b/web/app.py index 92c763c..dc292de 100644 --- a/web/app.py +++ b/web/app.py @@ -544,6 +544,13 @@ async def action_apply( flat = db.get_flat(flat_id) if not flat: raise HTTPException(404, "flat not found") + last = db.last_application_for_flat(user["id"], flat_id) + if last and last["finished_at"] is None: + # Another apply is already running for this user+flat; don't queue a second. + return _wohnungen_partial_or_redirect(request, user) + if last and last["success"] == 1: + # Already successfully applied — no point in re-running. + return _wohnungen_partial_or_redirect(request, user) db.log_audit(user["username"], "trigger_apply", f"flat_id={flat_id}", user_id=user["id"], ip=client_ip(request)) _kick_apply(user["id"], flat_id, flat["link"], "user") @@ -838,11 +845,14 @@ async def action_profile(request: Request, user=Depends(require_user)): try: return int(form.get(name) or 0) except ValueError: return 0 + # Field names are intentionally opaque ("contact_addr", "immomio_login", + # "immomio_secret") to keep password managers — specifically Bitwarden — + # from recognising the form as a login/identity form and autofilling. db.update_profile(user["id"], { "salutation": form.get("salutation", ""), "firstname": form.get("firstname", ""), "lastname": form.get("lastname", ""), - "email": form.get("email", ""), + "email": form.get("contact_addr", ""), "telephone": form.get("telephone", ""), "street": form.get("street", ""), "house_number": form.get("house_number", ""), @@ -855,8 +865,8 @@ async def action_profile(request: Request, user=Depends(require_user)): "wbs_adults": _i("wbs_adults"), "wbs_children": _i("wbs_children"), "is_prio_wbs": 1 if _b("is_prio_wbs") else 0, - "immomio_email": form.get("immomio_email", ""), - "immomio_password": form.get("immomio_password", ""), + "immomio_email": form.get("immomio_login", ""), + "immomio_password": form.get("immomio_secret", ""), }) db.log_audit(user["username"], "profile.updated", user_id=user["id"], ip=client_ip(request)) return RedirectResponse("/einstellungen/profil", status_code=303) diff --git a/web/templates/_settings_notifications.html b/web/templates/_settings_notifications.html index 0bd6f2a..23f952e 100644 --- a/web/templates/_settings_notifications.html +++ b/web/templates/_settings_notifications.html @@ -4,7 +4,7 @@