Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Handling: valid ags #112

Open
Jeniffere opened this issue Feb 16, 2022 · 3 comments
Open

Error Handling: valid ags #112

Jeniffere opened this issue Feb 16, 2022 · 3 comments

Comments

@Jeniffere
Copy link
Collaborator

Jeniffere commented Feb 16, 2022

python devtool.py run -ags 123 should return a good error message.
Currently it just throws an exception deep down in the code.
The error handling should be implemented at the beginning of make_entries.

--> Check the input ags for invalid values

  • only ags which are in the master.csv are allowed
  • implicit ags that are not a valid number are not allowed

--> Add test(s) for invalid value(s)

@Jeniffere
Copy link
Collaborator Author

FYI: Found: in knud: in src/germanzero_backend/apps/localzero/views.py:

if len(ags) > 8:
# TODO: This should not be here.
# if AGS is longer then 8, chances are there were special
# characters or prefixes entered
# that need to be removed, like "AGSXXXXXXXX" or "XX-X-XX-XXX"
ags = "".join(e for e in ags if e.isnumeric())`

@Jeniffere
Copy link
Collaborator Author

Jeniffere commented Feb 16, 2022

The website calls
entries = make_entries(data, ags=ags, year=year)

--> the error handling should be done in make_entries

@Jeniffere
Copy link
Collaborator Author

Jeniffere commented Feb 16, 2022

Possible test case Chemnitz (14511000)
python devtool.py run -ags 14511000

  • currently this ags is not in the master.csv, but the generator works for the ags
  • there should be an error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant