-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
15 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
[flake8] | ||
exclude = .git, __pycache__, .mypy_cache, .pytest_cache, venv, .github, \ | ||
stadsarkiv_client/templates,stadsarkiv_client/locales, generate_client, tests, \ | ||
example-config-aarhus, example-config-simple, example-config-teater, build | ||
example-config-aarhus, example-config-simple, example-config-teater, build, \ | ||
bin-local | ||
ignore = E203, W503, E402, E231 | ||
max-line-length = 140 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
from stadsarkiv_client.database.cache import DatabaseCache | ||
from stadsarkiv_client.database.crud_default import database_url | ||
from stadsarkiv_client.database.utils import DatabaseConnection | ||
from stadsarkiv_client.core import api | ||
from stadsarkiv_client.core.dynamic_settings import settings | ||
import random | ||
|
||
|
@@ -83,16 +82,16 @@ async def test_mail(request: Request): | |
|
||
# template_str = await get_template_content("mails/verify_email.html", context) | ||
|
||
data_dict = { | ||
"data": { | ||
"user_id": "01944542-2d7b-72bc-82bf-34e735b383cb", | ||
"subject": "Test", | ||
"sender": {"email": "[email protected]", "name": "Aarhus Stadsarkiv"}, | ||
"reply_to": {"email": "[email protected]", "name": "Aarhus Stadsarkiv"}, | ||
"html_content": "Test Test", | ||
"text_content": "Test Test", | ||
} | ||
} | ||
# data_dict = { | ||
# "data": { | ||
# "user_id": "01944542-2d7b-72bc-82bf-34e735b383cb", | ||
# "subject": "Test", | ||
# "sender": {"email": "[email protected]", "name": "Aarhus Stadsarkiv"}, | ||
# "reply_to": {"email": "[email protected]", "name": "Aarhus Stadsarkiv"}, | ||
# "html_content": "Test Test", | ||
# "text_content": "Test Test", | ||
# } | ||
# } | ||
|
||
# await api.mail_post(request, data_dict) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
Webhook endpoints | ||
""" | ||
|
||
from starlette.responses import JSONResponse, HTMLResponse | ||
from starlette.responses import JSONResponse | ||
from starlette.requests import Request | ||
from stadsarkiv_client.core.logging import get_log | ||
from stadsarkiv_client.core.mail import get_template_content | ||
|
@@ -116,36 +116,3 @@ async def mail_reset_token(request: Request): | |
log.exception("Error in sending reset email to user") | ||
|
||
return JSONResponse({"status": "ok", "data": data}) | ||
|
||
|
||
""" | ||
# Test data. This ID will not work if sending to the real API | ||
data: dict = { | ||
"nonce": "ya_X5caNnPNNV8I1DRjogmHzO3xoKBn2OffA5M1we4c", | ||
"context": {}, | ||
"original_request_id": "09c74815a76841d98da1268fdcb3b3e6", | ||
"error": None, | ||
"timestamp": 1736240547.001911, | ||
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIwMTk0NDAwMC00NDlhLTc0M2EtYjU4My0yNDJkMjNjMmNjZjgiLCJlbWFpbCI6IjAxOTQ0MDAwNDQ5NjcxMmVhODhiZmFlZjM2ODQ5MTY5QGludGVybmFsLmxvY2FsIiwiYXVkIjoiZmFzdGFwaS11c2Vyczp2ZXJpZnkiLCJleHAiOjE3MzYyNDQxNDZ9.dFuissS8vA7ZESmwPvH-aQy_Hn5zsY0Z4SJUhom9iY0", | ||
"to_user": { | ||
"id": "019265e5-3fd4-7734-990c-7c7660d1ca64", | ||
"email": "[email protected]", | ||
"is_active": True, | ||
"is_verified": False, | ||
"client_id": "demo", | ||
"display_name": "diversen", | ||
"data": {"bookmarks": [], "custom": {"updated": 1736240547, "data": {}}}, | ||
"timestamp": 1736240546, | ||
"updated": 1736240546, | ||
"last_login": 1736240546, | ||
"permissions": [ | ||
{"name": "user", "grant_id": 6, "entity_id": None}, | ||
{"name": "guest", "grant_id": 8, "entity_id": None}, | ||
{"name": "read", "grant_id": 9, "entity_id": None}, | ||
], | ||
}, | ||
} | ||
""" |