This commit is contained in:
Adrià Casajús 2022-05-02 11:53:32 +02:00
parent ba46ce5208
commit 56159765d9
No known key found for this signature in database
GPG Key ID: F0033226A5AFC9B9
3 changed files with 5 additions and 5 deletions

View File

@ -338,7 +338,7 @@ ALERT_DIRECTORY_DISABLED_ALIAS_CREATION = "alert_directory_disabled_alias_creati
ALERT_COMPLAINT_REPLY_PHASE = "alert_complaint_reply_phase"
ALERT_COMPLAINT_FORWARD_PHASE = "alert_complaint_forward_phase"
ALERT_COMPLAINT_TO_USER = "alert_complaint_to_user"
ALERT_COMPLAINT_TRANSACTIONAL_PHASE = "alert_complaint_transactional_phase"
ALERT_QUARANTINE_DMARC = "alert_quarantine_dmarc"

View File

@ -7,7 +7,7 @@ from typing import Optional
from app import s3
from app.config import (
ALERT_COMPLAINT_REPLY_PHASE,
ALERT_COMPLAINT_TO_USER,
ALERT_COMPLAINT_TRANSACTIONAL_PHASE,
ALERT_COMPLAINT_FORWARD_PHASE,
)
from app.email import headers
@ -171,7 +171,7 @@ def report_complaint_to_user_in_transactional_phase(
capitalized_name = origin.name().capitalize()
send_email_with_rate_control(
user,
f"{ALERT_COMPLAINT_TO_USER}_{origin.name()}",
f"{ALERT_COMPLAINT_TRANSACTIONAL_PHASE}_{origin.name()}",
user.email,
f"Abuse report from {capitalized_name}",
render(

View File

@ -8,7 +8,7 @@ import pytest
from app.config import (
ALERT_COMPLAINT_FORWARD_PHASE,
ALERT_COMPLAINT_REPLY_PHASE,
ALERT_COMPLAINT_TO_USER,
ALERT_COMPLAINT_TRANSACTIONAL_PHASE,
)
from app.db import Session
from app.email import headers
@ -51,7 +51,7 @@ def test_provider_to_user(flask_client, handle_ftor, provider, part_num):
assert len(found) == 0
alerts = SentAlert.filter_by(user_id=user.id).all()
assert len(alerts) == 1
assert alerts[0].alert_type == f"{ALERT_COMPLAINT_TO_USER}_{provider}"
assert alerts[0].alert_type == f"{ALERT_COMPLAINT_TRANSACTIONAL_PHASE}_{provider}"
@pytest.mark.parametrize("handle_ftor,provider,part_num", origins)