Fix: needs_dog_selection TEXT '0' war truthy — INTEGER + === 1 Check (SW by-v946)
This commit is contained in:
parent
3b666c545f
commit
1ea8127aaf
4 changed files with 16 additions and 10 deletions
|
|
@ -2153,16 +2153,22 @@ def _migrate(conn_factory):
|
|||
pass
|
||||
|
||||
# ---- Feature: Subscription-Laufzeit & Kündigung ----
|
||||
for col, default in [
|
||||
("subscription_expires_at", "NULL"),
|
||||
("subscription_cancelled_at","NULL"),
|
||||
("needs_dog_selection", "0"),
|
||||
for col, typedef in [
|
||||
("subscription_expires_at", "TEXT DEFAULT NULL"),
|
||||
("subscription_cancelled_at", "TEXT DEFAULT NULL"),
|
||||
("needs_dog_selection", "INTEGER DEFAULT 0"),
|
||||
]:
|
||||
try:
|
||||
conn.execute(f"ALTER TABLE users ADD COLUMN {col} TEXT DEFAULT {default}")
|
||||
conn.execute(f"ALTER TABLE users ADD COLUMN {col} {typedef}")
|
||||
logger.info(f"Migration: {col} hinzugefügt.")
|
||||
except Exception:
|
||||
pass
|
||||
# Bestehende TEXT-Werte für needs_dog_selection auf 0/1 normalisieren
|
||||
try:
|
||||
conn.execute("UPDATE users SET needs_dog_selection=0 WHERE needs_dog_selection='0' OR needs_dog_selection IS NULL")
|
||||
conn.execute("UPDATE users SET needs_dog_selection=1 WHERE needs_dog_selection='1'")
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# exercise_progress + training_plan_progress: dog_id ergänzen
|
||||
existing_ep = [r[1] for r in conn.execute("PRAGMA table_info(exercise_progress)").fetchall()]
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ async def serve_media(path: str, request: _Request):
|
|||
raise _HE(404, "Nicht gefunden.")
|
||||
return _media_response(filepath)
|
||||
|
||||
APP_VER = "945" # muss mit APP_VER in app.js übereinstimmen
|
||||
APP_VER = "946" # muss mit APP_VER in app.js übereinstimmen
|
||||
|
||||
@app.get("/.well-known/assetlinks.json")
|
||||
async def assetlinks():
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Router, State-Management, Navigation, Initialisierung.
|
||||
============================================================ */
|
||||
|
||||
const APP_VER = '945'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||
const APP_VER = '946'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||
const APP_VERSION = '1.5.1'; // ← semantische Version, wird bei make release gesetzt
|
||||
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
||||
// Cache-Bust-Parameter nach Update-Reload sofort entfernen
|
||||
|
|
@ -567,8 +567,8 @@ const App = (() => {
|
|||
navigate('onboarding');
|
||||
}
|
||||
|
||||
// Abo abgelaufen mit mehreren Hunden → Haupthund auswählen
|
||||
if (state.user.needs_dog_selection && state.dogs.length > 1) {
|
||||
// Abo abgelaufen mit mehreren Hunden → Haupthund auswählen (nur wenn explizit 1, nicht "0" string)
|
||||
if (state.user.needs_dog_selection === 1 && state.dogs.length > 1) {
|
||||
_showDogSelectionModal();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Offline-Cache + Push Notifications + Tile-Cache
|
||||
============================================================ */
|
||||
|
||||
const CACHE_VERSION = 'by-v945';
|
||||
const CACHE_VERSION = 'by-v946';
|
||||
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
||||
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
||||
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue