Skip to content

Commit

Permalink
Merge pull request #191 from oslokommune/remove-external-client-report
Browse files Browse the repository at this point in the history
Remove the external client report
  • Loading branch information
simenheg authored Oct 24, 2024
2 parents 89b578e + 65b32e5 commit c3e8680
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 52 deletions.
41 changes: 0 additions & 41 deletions jobs/client_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
),
)
11 changes: 0 additions & 11 deletions serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,6 @@ functions:
rate: cron(0 0 1 * ? *)
enabled: ${self:custom.clientReportEnabled.${opt:stage, self:provider.stage}}
timeout: 300
# client-report-external:
# image:
# name: okdata-maskinporten-api
# command:
# - jobs.client_report.send_client_report_external
# events:
# - schedule:
# # At 10:00 on 10/10 every year (the security month).
# rate: cron(0 10 10 10 ? *)
# enabled: ${self:custom.clientReportEnabled.${opt:stage, self:provider.stage}}
# timeout: 300
key-rotator:
image:
name: okdata-maskinporten-api
Expand Down

0 comments on commit c3e8680

Please sign in to comment.