ROLLBACK: complete removal of broken feature enforcement system
Reverts all feature enforcement changes (commits3745ebd,cbad50a,cd4d912,8415509) to restore original working functionality. Issues caused by feature enforcement implementation: - Export buttons disappeared and never reappeared - KI analysis counter not incrementing - New analyses not saving - Pipeline appearing twice - Many core features broken Restored files to working state before enforcement implementation (commit0210844): - Backend: auth.py, insights.py, exportdata.py, importdata.py, nutrition.py, activity.py - Frontend: Analysis.jsx, SettingsPage.jsx, api.js - Removed: FeatureGate.jsx, useFeatureAccess.js The original simple AI limit system (ai_enabled, ai_limit_day) is now active again. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
8415509f4c
commit
4fcde4abfb
11 files changed
+125
-376
No files matched your search
@@ -11,7 +11,7 @@ from typing import Optional
|
||||
from fastapi import APIRouter, HTTPException, UploadFile, File, Header, Depends
|
||||
|
||||
from db import get_db, get_cursor, r2d
|
||||
from auth import require_auth, check_feature_access, increment_feature_usage
|
||||
from auth import require_auth
|
||||
from models import ActivityEntry
|
||||
from routers.profiles import get_pid
|
||||
|
||||
@@ -94,17 +94,6 @@ def activity_stats(x_profile_id: Optional[str]=Header(default=None), session: di
|
||||
async def import_activity_csv(file: UploadFile=File(...), x_profile_id: Optional[str]=Header(default=None), session: dict=Depends(require_auth)):
|
||||
"""Import Apple Health workout CSV."""
|
||||
pid = get_pid(x_profile_id)
|
||||
|
||||
# Check feature access (v9c feature system)
|
||||
access = check_feature_access(pid, 'csv_import')
|
||||
if not access['allowed']:
|
||||
if access['reason'] == 'feature_disabled':
|
||||
raise HTTPException(403, "CSV-Import ist für dein Tier nicht verfügbar")
|
||||
elif access['reason'] == 'limit_exceeded':
|
||||
raise HTTPException(429, f"Monatliches Import-Limit erreicht ({access['limit']} Imports)")
|
||||
else:
|
||||
raise HTTPException(403, f"Zugriff verweigert: {access['reason']}")
|
||||
|
||||
raw = await file.read()
|
||||
try: text = raw.decode('utf-8')
|
||||
except: text = raw.decode('latin-1')
|
||||
@@ -145,8 +134,4 @@ async def import_activity_csv(file: UploadFile=File(...), x_profile_id: Optional
|
||||
tf(row.get('Distanz (km)',''))))
|
||||
inserted+=1
|
||||
except: skipped+=1
|
||||
|
||||
# Increment import usage counter (v9c feature system)
|
||||
increment_feature_usage(pid, 'csv_import')
|
||||
|
||||
return {"inserted":inserted,"skipped":skipped,"message":f"{inserted} Trainings importiert"}
|
||||
Reference in new issue
Block a user