Fix: Hund-Limit Standard-User (max 1, Pro required für weitere), nacho_sarah → Pro (SW by-v834)
This commit is contained in:
parent
70af387147
commit
2f021f54c2
5 changed files with 19 additions and 11 deletions
|
|
@ -343,7 +343,7 @@ MEDIA_DIR = os.getenv("MEDIA_DIR", "/data/media")
|
||||||
os.makedirs(MEDIA_DIR, exist_ok=True)
|
os.makedirs(MEDIA_DIR, exist_ok=True)
|
||||||
app.mount("/media", StaticFiles(directory=MEDIA_DIR), name="media")
|
app.mount("/media", StaticFiles(directory=MEDIA_DIR), name="media")
|
||||||
|
|
||||||
APP_VER = "833" # muss mit APP_VER in app.js übereinstimmen
|
APP_VER = "834" # muss mit APP_VER in app.js übereinstimmen
|
||||||
|
|
||||||
@app.get("/.well-known/assetlinks.json")
|
@app.get("/.well-known/assetlinks.json")
|
||||||
async def assetlinks():
|
async def assetlinks():
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ from fastapi import APIRouter, Depends, HTTPException, UploadFile, File
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
from database import db
|
from database import db
|
||||||
from auth import get_current_user
|
from auth import get_current_user, has_pro_access
|
||||||
from routes.push import send_push_to_user
|
from routes.push import send_push_to_user
|
||||||
from media_utils import safe_media_path, preview_url_from
|
from media_utils import safe_media_path, preview_url_from
|
||||||
|
|
||||||
|
|
@ -131,6 +131,14 @@ def _is_plausible_dog(name: str, rasse: str, geburtstag) -> tuple[bool, str]:
|
||||||
@router.post("")
|
@router.post("")
|
||||||
async def create_dog(data: DogCreate, user=Depends(get_current_user)):
|
async def create_dog(data: DogCreate, user=Depends(get_current_user)):
|
||||||
with db() as conn:
|
with db() as conn:
|
||||||
|
existing = conn.execute(
|
||||||
|
"SELECT COUNT(*) FROM dogs WHERE user_id=?", (user["id"],)
|
||||||
|
).fetchone()[0]
|
||||||
|
if existing >= 1 and not has_pro_access(user):
|
||||||
|
raise HTTPException(
|
||||||
|
status_code=403,
|
||||||
|
detail="Mehrere Hunde sind ein Pro-Feature. Upgrade auf Ban Yaro Pro, um weitere Hunde anzulegen."
|
||||||
|
)
|
||||||
conn.execute(
|
conn.execute(
|
||||||
"""INSERT INTO dogs (user_id, name, rasse, geburtstag, geschlecht,
|
"""INSERT INTO dogs (user_id, name, rasse, geburtstag, geschlecht,
|
||||||
gewicht_kg, chip_nr, bio, is_public)
|
gewicht_kg, chip_nr, bio, is_public)
|
||||||
|
|
|
||||||
|
|
@ -101,9 +101,9 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- CSS: Reihenfolge ist wichtig — ?v= zwingt Browser zur Neuladung -->
|
<!-- CSS: Reihenfolge ist wichtig — ?v= zwingt Browser zur Neuladung -->
|
||||||
<link rel="stylesheet" href="/css/design-system.css?v=833">
|
<link rel="stylesheet" href="/css/design-system.css?v=834">
|
||||||
<link rel="stylesheet" href="/css/layout.css?v=833">
|
<link rel="stylesheet" href="/css/layout.css?v=834">
|
||||||
<link rel="stylesheet" href="/css/components.css?v=833">
|
<link rel="stylesheet" href="/css/components.css?v=834">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|
@ -583,10 +583,10 @@
|
||||||
<div id="modal-container"></div>
|
<div id="modal-container"></div>
|
||||||
|
|
||||||
<!-- JS: Reihenfolge ist wichtig — erst Basis, dann Features -->
|
<!-- JS: Reihenfolge ist wichtig — erst Basis, dann Features -->
|
||||||
<script src="/js/api.js?v=833"></script>
|
<script src="/js/api.js?v=834"></script>
|
||||||
<script src="/js/ui.js?v=833"></script>
|
<script src="/js/ui.js?v=834"></script>
|
||||||
<script src="/js/app.js?v=833"></script>
|
<script src="/js/app.js?v=834"></script>
|
||||||
<script src="/js/worlds.js?v=833"></script>
|
<script src="/js/worlds.js?v=834"></script>
|
||||||
|
|
||||||
<!-- Feature-Seiten werden lazy geladen -->
|
<!-- Feature-Seiten werden lazy geladen -->
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
Router, State-Management, Navigation, Initialisierung.
|
Router, State-Management, Navigation, Initialisierung.
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
const APP_VER = '833'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
const APP_VER = '834'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||||
const APP_VERSION = '1.5.0'; // ← semantische Version, wird bei make release gesetzt
|
const APP_VERSION = '1.5.0'; // ← semantische Version, wird bei make release gesetzt
|
||||||
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
||||||
// Cache-Bust-Parameter nach Update-Reload sofort entfernen
|
// Cache-Bust-Parameter nach Update-Reload sofort entfernen
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
Offline-Cache + Push Notifications + Tile-Cache
|
Offline-Cache + Push Notifications + Tile-Cache
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
const CACHE_VERSION = 'by-v833';
|
const CACHE_VERSION = 'by-v834';
|
||||||
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
||||||
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
||||||
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
|
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue