XLSForm / pyxform

A Python package to create XForms for ODK Collect.
BSD 2-Clause "Simplified" License
80 stars 136 forks source link

660: nicer error about choices sheet when extension omitted in select_.._from_file #673

Closed lindsay-stevens closed 10 months ago

lindsay-stevens commented 10 months ago

Closes #660

Why is this the best possible solution? Were any other approaches considered?

Previously, an error about a missing sheet name may be thrown, e.g. if the form didn't contain any regular choices. This change explicitly checks for file extension, in order to show a nicer error message. The existing constants, aliases, and validation pattern are used.

What are the regression risks?

I think this is just an enhancement, since the old behaviour was confusing, and in both cases an error is raised.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

No it's already documented in the template, just an easy mistake to make

image

Before submitting this PR, please make sure you have:

lognaturel commented 10 months ago

Yay, @lindsay-stevens out here making my life so much better! (And hopefully that of other users, too 😊)

lognaturel commented 5 months ago

Just got this error again, such a big improvement!