mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 15:12:08 +01:00
Compare commits
3 Commits
da0c77101d
...
merge/core
| Author | SHA1 | Date | |
|---|---|---|---|
| c689caea88 | |||
| 8c20deb690 | |||
| 39979b51ee |
@@ -656,6 +656,11 @@ FastAPI lacks usable build in support for database migrations and implementing A
|
||||
Tricky was also integrating FastAPI auth system with React frontend, since there is no official project template.
|
||||
Using .NET (which we considered initially) would probably solve these issues.
|
||||
|
||||
#### Private container registry
|
||||
|
||||
Using private container registry would allow us to include environment variables directly in the image during build.
|
||||
This would simplify deployment and CI/CD setup.
|
||||
|
||||
[What would you do differently? What worked well that you'd keep?]
|
||||
|
||||
### Individual Growth
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
import app.celery_app # noqa: F401
|
||||
from app.workers.celery_tasks import send_email
|
||||
|
||||
|
||||
def enqueue_email(to: str, subject: str, body: str) -> None:
|
||||
send_email.delay(to, subject, body)
|
||||
@@ -14,11 +14,10 @@ from httpx_oauth.oauth2 import BaseOAuth2
|
||||
|
||||
from app.models.user import User
|
||||
from app.oauth.bank_id import BankID
|
||||
from app.oauth.csas import CSASOAuth
|
||||
from app.workers.celery_tasks import send_email
|
||||
from app.oauth.custom_openid import CustomOpenID
|
||||
from app.oauth.moje_id import MojeIDOAuth
|
||||
from app.services.db import get_user_db
|
||||
from app.core.queue import enqueue_email
|
||||
|
||||
SECRET = os.getenv("SECRET", "CHANGE_ME_SECRET")
|
||||
|
||||
@@ -87,7 +86,7 @@ class UserManager(UUIDIDMixin, BaseUserManager[User, uuid.UUID]):
|
||||
"Pokud jsi registraci neprováděl(a), tento email ignoruj.\n"
|
||||
)
|
||||
try:
|
||||
enqueue_email(to=user.email, subject=subject, body=body)
|
||||
send_email.delay(user.email, subject, body)
|
||||
except Exception as e:
|
||||
print("[Email Fallback] To:", user.email)
|
||||
print("[Email Fallback] Subject:", subject)
|
||||
|
||||
@@ -34,7 +34,8 @@ def test_authenticated_route_requires_auth(client):
|
||||
async def test_on_after_request_verify_enqueues_email(monkeypatch):
|
||||
calls = {}
|
||||
|
||||
def fake_enqueue_email(to: str, subject: str, body: str):
|
||||
class FakeCeleryTask:
|
||||
def delay(to: str, subject: str, body: str):
|
||||
calls.setdefault("emails", []).append({
|
||||
"to": to,
|
||||
"subject": subject,
|
||||
@@ -42,7 +43,7 @@ async def test_on_after_request_verify_enqueues_email(monkeypatch):
|
||||
})
|
||||
|
||||
# Patch the enqueue_email used inside user_service
|
||||
monkeypatch.setattr(user_service, "enqueue_email", fake_enqueue_email)
|
||||
monkeypatch.setattr(user_service, "send_email", FakeCeleryTask)
|
||||
|
||||
class DummyUser:
|
||||
def __init__(self, email):
|
||||
|
||||
Reference in New Issue
Block a user