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 @@

+ autocomplete="off" data-lpignore="true" data-1p-ignore data-bwignore data-form-type="other">
@@ -18,13 +18,13 @@
+ placeholder="123456:ABC..." autocomplete="off" data-lpignore="true" data-1p-ignore data-bwignore>

Bot bei @BotFather anlegen, Token hier eintragen.

+ placeholder="987654321" autocomplete="off" data-lpignore="true" data-1p-ignore data-bwignore>
diff --git a/web/templates/_settings_profil.html b/web/templates/_settings_profil.html index e604feb..03486a8 100644 --- a/web/templates/_settings_profil.html +++ b/web/templates/_settings_profil.html @@ -1,7 +1,7 @@

Bewerbungsdaten

+ autocomplete="off" data-lpignore="true" data-1p-ignore data-bwignore data-form-type="other"> {# Honeypot: Chrome/Firefox password managers ignore autocomplete="off" but autofill the *first* email+password pair they find. These hidden fields @@ -24,39 +24,39 @@
- +
- +
- +
- +
- +
- +
- +
- +
@@ -104,14 +104,14 @@
- +
- + autocomplete="new-password" data-lpignore="true" data-1p-ignore data-bwignore>
diff --git a/web/templates/_settings_users.html b/web/templates/_settings_users.html index ac261f5..b4e9517 100644 --- a/web/templates/_settings_users.html +++ b/web/templates/_settings_users.html @@ -8,11 +8,11 @@

Neuen Benutzer anlegen

+ autocomplete="off" data-lpignore="true" data-1p-ignore data-bwignore data-form-type="other">
- +
diff --git a/web/templates/_wohnungen_body.html b/web/templates/_wohnungen_body.html index 128f213..f733845 100644 --- a/web/templates/_wohnungen_body.html +++ b/web/templates/_wohnungen_body.html @@ -125,13 +125,9 @@ {% if f.rooms %}{{ "%.1f"|format(f.rooms) }} Z{% endif %} {% if f.size %} · {{ "%.0f"|format(f.size) }} m²{% endif %} {% if f.total_rent %} · {{ "%.0f"|format(f.total_rent) }} €{% endif %} - {% if f.connectivity_morning_time %} · {{ "%.0f"|format(f.connectivity_morning_time) }} min morgens{% endif %} {% if f.wbs %} · WBS: {{ f.wbs }}{% endif %} - · entdeckt + ·
- {% if item.last and item.last.message %} -
↳ {{ item.last.message }}
- {% endif %}
{% if apply_allowed and not (item.last and item.last.success == 1) %}