tejash300 commited on
Commit
e6cd574
·
verified ·
1 Parent(s): 451fd96

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -717,7 +717,7 @@ async def analyze_legal_document(
717
  }
718
 
719
  # Add premium features if user has access
720
- if current_user.subscription_tier == "free_tier": # was premium
721
  # Add detailed risk assessment
722
  if "detailed_risk_assessment" in SUBSCRIPTION_TIERS[current_user.subscription_tier]["features"]:
723
  detailed_risk = get_detailed_risk_info(text)
@@ -1415,12 +1415,8 @@ async def paypal_webhook(request: Request):
1415
  # Return 200 even on error to acknowledge receipt to PayPal
1416
  return {"status": "error", "message": str(e)}
1417
  @app.get("/download_risk_chart")
1418
- async def download_risk_chart(current_user: User = Depends(get_current_active_user)):
1419
- if "detailed_risk_assessment" not in SUBSCRIPTION_TIERS[current_user.subscription_tier]["features"]:
1420
- raise HTTPException(
1421
- status_code=403,
1422
- detail=f"The risk visualization feature is not available in your {current_user.subscription_tier} subscription."
1423
- )
1424
  try:
1425
  risk_scores = {
1426
  "Liability": 11,
@@ -1547,4 +1543,4 @@ async def startup_event():
1547
  print(f"Error during startup: {str(e)}")
1548
 
1549
  if __name__ == "__main__":
1550
- uvicorn.run("app:app", host="0.0.0.0", port=7860, reload=True)
 
717
  }
718
 
719
  # Add premium features if user has access
720
+ if current_user.subscription_tier == "premium_tier":
721
  # Add detailed risk assessment
722
  if "detailed_risk_assessment" in SUBSCRIPTION_TIERS[current_user.subscription_tier]["features"]:
723
  detailed_risk = get_detailed_risk_info(text)
 
1415
  # Return 200 even on error to acknowledge receipt to PayPal
1416
  return {"status": "error", "message": str(e)}
1417
  @app.get("/download_risk_chart")
1418
+ async def download_risk_chart():
1419
+ """Generate and return a risk assessment chart as an image file."""
 
 
 
 
1420
  try:
1421
  risk_scores = {
1422
  "Liability": 11,
 
1543
  print(f"Error during startup: {str(e)}")
1544
 
1545
  if __name__ == "__main__":
1546
+ uvicorn.run("app:app", host="0.0.0.0", port=7860, reload=True)