Avinashnalla7 commited on
Commit
7080630
·
1 Parent(s): 089f46d

Remove Gmail from HF API (store-only send-config)

Browse files
Files changed (1) hide show
  1. backend/api.py +0 -20
backend/api.py CHANGED
@@ -18,9 +18,6 @@ def _env(*keys: str, default: str = "") -> str:
18
 
19
  from fastapi.middleware.cors import CORSMiddleware
20
  from fastapi.responses import FileResponse, PlainTextResponse
21
-
22
- from backend.worker.gmail_client import GmailClient
23
-
24
  app = FastAPI(title="PDF Trainer API", version="1.0")
25
 
26
  # Allow Vite dev server
@@ -44,13 +41,6 @@ CONFIGS_DIR = UPLOADS_DIR / "configs"
44
  # Load backend/.env explicitly ONCE for this process
45
  load_dotenv(BACKEND_DIR / ".env", override=True)
46
 
47
- CREDENTIALS_JSON = Path(os.environ.get("GMAIL_CREDENTIALS_JSON", str(BACKEND_DIR / "credentials.json")))
48
- TOKEN_JSON = Path(os.environ.get("GMAIL_TOKEN_JSON", str(BACKEND_DIR / "token.json")))
49
-
50
-
51
- def _gmail() -> GmailClient:
52
- return GmailClient(CREDENTIALS_JSON, TOKEN_JSON)
53
-
54
 
55
  def _get_env_required(key: str) -> str:
56
  v = (os.environ.get(key) or "").strip()
@@ -158,16 +148,6 @@ async def notify_unknown(payload: Dict[str, Any]):
158
  )
159
 
160
  attachments = [(pdf_name, pdf_path.read_bytes())]
161
-
162
- gmail = _gmail()
163
- gmail.send_email(
164
- to_email=rep_to,
165
- from_email=notify_from,
166
- subject=subject,
167
- body_text=body,
168
- attachments=attachments,
169
- )
170
-
171
  return {"ok": True}
172
 
173
 
 
18
 
19
  from fastapi.middleware.cors import CORSMiddleware
20
  from fastapi.responses import FileResponse, PlainTextResponse
 
 
 
21
  app = FastAPI(title="PDF Trainer API", version="1.0")
22
 
23
  # Allow Vite dev server
 
41
  # Load backend/.env explicitly ONCE for this process
42
  load_dotenv(BACKEND_DIR / ".env", override=True)
43
 
 
 
 
 
 
 
 
44
 
45
  def _get_env_required(key: str) -> str:
46
  v = (os.environ.get(key) or "").strip()
 
148
  )
149
 
150
  attachments = [(pdf_name, pdf_path.read_bytes())]
 
 
 
 
 
 
 
 
 
 
151
  return {"ok": True}
152
 
153