20121127¶
Monitoring a Lino site¶
Lino should be able to send every day a monitor status to the admins of a site. The first useful thing in such a status seems to be certain warnings:
if the size on disk or number of records of a model has grown abnormally
available disk space and size of log files
lino.management.commands.diag
is not the right candidate
to do this job (main purpose is a logical comparison of two dumps),
so we write a new command for this:
lino.management.commands.monitor
.
How to find out the disk size used by the database table of each model?
Currently only for the mysql backend.
PostGreSQL should be easy, too.
sqlite would be more tricky (https://stackoverflow.com/questions/5900050/sqlite-table-disk-usage) and probably never necessaary.
Okay, here is some first visible result:
luc@vps:~/mypy/demo_sites/welfare$ python manage.py monitor
INFO Loaded 2 states from /home/luc/mypy/demo_sites/welfare/states.pck
INFO Changes since 2012-11-27 08:34:50.240809:
- cv.LanguageKnowledge rows : 122 -> 121
- cv.LanguageKnowledge bytes : 10992 -> 10972
INFO Saved 3 states to /home/luc/mypy/demo_sites/welfare/states.pck
But there’s still a lot to do. Not urgent.
Bugfixes¶
There was a bug in
lino.Lino.is_installed()
: is_installed(‘lino’) always returned False. This caused UserProfiles to lack in the definition of global choicelists in lino*.js.When using
lino.Lino.remote_user_header
it was possible to authenticate as a user whose profile was empty. This then caused a message “AttributeError. ‘NoneType’ object has no attribute ‘level’”. Now the message is “Unknown or inactive username ‘nicole’. Please contact your system administrator.”
Managers may edit other user’s work…¶
The new attribute
lino.mixins.UserAuthored.manager_level_field
is to solve a subtle problem. See docstring.
Used on lino_welfare.modlib.isip.ContractBase
Managers may edit other user’s work…
Miscellaneous¶
When trying to render something as pdf on any of the demo sites, (e.g. clicking the [pdf] button at http://demo1.lino-framework.org/api/polls/Polls), the server said “An error occurred during the conversion. Doc URL “/home/luc/mypy/demo_sites/polls/media/cache/appypdf/polls.Polls.pdf.1354022098.282635/result.odt” is wrong. URL seems to be an unsupported one.”
That was just because forgot to install openoffice-writer on the server. Took me some time to discover the reason, though. Thanks to https://stackoverflow.com/questions/7377012/openoffice-api-url-seems-to-be-an-unsupported-one for shedding light over this.
Error while evaluating expression “settings.LINO.site_version()”. cannot concatenate ‘str’ and ‘NoneType’ objects
When trying to create a Posting from a Postable (e.g. a Note), the action failed and the server reported “ValidationError {‘state’: [u’Dieses Feld darf nicht leer sein.’]}”
New class
lino.modlib.contacts.utils.GenderItem
with a methodmf
.Lino-Welfare 1.0.4 pre-released