Thursday, February 26, 2015

The period of a confirmation

Melanie reported some grammar bugs in the “when” text of confirmations. Ticket #113.

  • The Confirmation.start_date no longer defaults to today. Leaving both dates empty is now accepted as a valid confirmation and means that the confirmation does not mention any period in its text.

  • Moved the business logic from lino_welfare.modlib.aids.mixins.Confirmation to lino.mixins.periods.DatePeriod.

  • Added a section “The period of a confirmation” to aids : Aid grantings

Validating an action parameter form

A user in Eupen discovered the following bug: CreateClientVisit accepts to create visits with an empty user field.

And indeed, the client-side form validation does not work here. Ticket #114.

As a workaround I test it now manually in the action’s run_from_ui method:

if not pv.user:
    raise Warning(_("Please select a user!"))

This caused another subtle change with possible side effects: when run_from_ui raises an exception, Lino (until now) still closed the action form window. Now the window is closed only when the action runs without anyu exception.

Directory not empty: ‘…/lino/tmp/result.odt.1424701578.354042’

Mahmoud solved ticket #109.

ImportError: No module named bs4

Ha! I found the explanation for the current problem on travis. The Lino test suite was failing there with error messages ImportError: No module named bs4. Explanation:

beautifulsoup4 is actually needed only when you want to run the test suite, not for normal operation. Despite this it must be specified in install_requires, not in tests_require, because the doctests are run in the environment specified by install_requires. (Don’t ask me whyatelier.test.TestCase.run_simple_doctests() uses the python specified by sys.executable, which seems a robust approach.)

The same is true for html5lib, reportlab and pisa.

Now that this riddle is finally solved, there are unfortunately more failures of the test suite on travis (sigh!). One of them was an easy pick: https://www.lino-framework.org/dev/translate/index.html required Lino Così. But the remaining ones are again quite a brain-teaser for a poor guy as me. The build log is here