-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #191 from oslokommune/remove-external-client-report
Remove the external client report
- Loading branch information
Showing
2 changed files
with
0 additions
and
52 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 |
---|---|---|
|
@@ -206,44 +206,3 @@ def send_client_report_internal(event, context): | |
_send_email(["[email protected]"], report) | ||
else: | ||
logger.info("No errors to report!") | ||
|
||
|
||
@logging_wrapper | ||
@xray_recorder.capture("send_client_report_external") | ||
def send_client_report_external(event, context): | ||
"""Send a report to each team with any registered Maskinporten clients.""" | ||
teams = {} | ||
|
||
for env in MASKINPORTEN_ENVS: | ||
for client in _active_clients(env): | ||
client["env"] = env | ||
try: | ||
for team in _client_teams(client, env): | ||
if email := team["attributes"].get("email"): | ||
team_entry = teams.setdefault( | ||
team["name"], | ||
Team(email, []), | ||
) | ||
team_entry.clients.append(client) | ||
except ClientWarning: | ||
# Nothing to do about these at this point. | ||
pass | ||
|
||
for team_name, team in teams.items(): | ||
_send_email( | ||
team.emails, | ||
"\n\n".join( | ||
[ | ||
f"Hei {team_name}!", | ||
"Dere har følgende klienter registrert i Maskinporten:", | ||
*map(_format_client, team.clients), | ||
( | ||
"Husk at aktive klienter til enhver tid må være " | ||
"registrert i behandlingsoversikten. Klienter som " | ||
"ikke lenger er i bruk kan slettes ved å bruke " | ||
"okdata-cli." | ||
), | ||
"Hilsen Dataspeilet", | ||
] | ||
), | ||
) |
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