GermanZero-de / localzero-generator-core

7 stars 3 forks source link

Error Handling: valid ags #112

Open Jeniffere opened 2 years ago

Jeniffere commented 2 years ago

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

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

Jeniffere commented 2 years ago

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 commented 2 years ago

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

--> the error handling should be done in make_entries

Jeniffere commented 2 years ago

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

Jeniffere commented 1 day ago

Chemnitz is now in the master.csv -> so please find another test case ;)