Skip to content

Commit

Permalink
Merge pull request #4336 from ebmdatalab/evansd/trud-login-failure
Browse files Browse the repository at this point in the history
Raise an explicit error for TRUD login failure
  • Loading branch information
evansd authored Sep 21, 2023
2 parents 3a0c38d + d674450 commit bf41a1d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openprescribing/dmd/management/commands/fetch_dmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def handle(self, *args, **kwargs):
"commit": "LOG+IN",
}
rsp = session.post(login_url, params)
if "The email address or password is invalid" in rsp.text:
raise RuntimeError(
f"TRUD login failure for username: {settings.TRUD_USERNAME!r}"
)

index_url = (
base_url
Expand Down

0 comments on commit bf41a1d

Please sign in to comment.