Monday, December 19, 2016¶
During the weekend I worked on #1307 (register new users).
admin_main_base.html, the sentence “You will now probably
want to log in using the Log in button in the upper right
corner” is now extended by an “Or _register_ as a new user.”
This action link was a challenge because we don’t simply want an action with a dialog window because we don’t want to redefine every field. It is actually just a customized insert_layout.
To solve this, I added a new class method
which I override in
Another question was: how to handle the fact that anonymous users
are -at least until now- readonly and therefore have no permission to
insert records into the database. Current answer: The new online
Online registration feature is available only on sites whose
AnonymousUser has readonly=False (which is currently done only in
>>> from lino import startup >>> startup('lino_noi.projects.care.settings.demo') >>> from lino.api.doctest import * >>> rt.models.users.RegisterNewUser.editable True >>> rt.models.users.RegisterUsers.update_action <BoundAction(users.RegisterUsers, <SaveGridCell grid_put>)>
admin_main_base.htmlwe test whether anonymous user is readonly when me actually should test whether the online registration feature is installed. A more explicit option would be better, e.g. a plugin attribute.
Move the logics implemented in
lino.modlib.extjs.ext_renderer.ExtRenderer.html_page_user()from there to
Workflow for managing new users¶
I added a workflow for managing users. System administrators now can “activate”, “deactivate” or “reset” users. They have a list of new users to be activated. Activating a user requires the user type to be set. Currently there is no way to define a default user type.
Two new database fields
User.user_state. A new choicelist
Duplicate welcome messages¶
I observed #1309 which causes welcome messages to be
Site object is being initialized twice,
and each time the whole startup process is being called:
$ go min1 $ runserver 20161219 do_site_startup() <lino_book.projects.min1.settings.demo.Site object at 0x7fbb52272a90> 20161219 do_site_startup() done 20161219 do_site_startup() <lino_book.projects.min1.settings.demo.Site object at 0x7f7a2483cad0> 20161219 do_site_startup() done Performing system checks... System check identified no issues (0 silenced). December 18, 2016 - 06:02:35 Django version 1.9.11, using settings 'lino_book.projects.min1.settings.demo' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C.
Explanation: the reason was not the double import (which is just a
traditional and well documented
Django oddness), the reason was a bug in the code which collects
welcome message handlers for tables having
welcome_message_when_count set. If a site has more than one
such tables, then the last of them was being called once for each of
them. I saw a double message “You have 8 items in New user
applications”, the first one should have been “You have 7 items in
Tickets to triage”.
I started using a
lino.modlib.users(which required to define that module for all users plugins).
lino.modlib.usershas an isolated desktop design, the difference between
UndefinedError: ‘module object’ has no attribute ‘RegisterUsers’
I removed the tinymce and clocking plugins from Lino Care.
lino_xl.lib.countries.models.Countriestable should not be visible for simple users in Lino Care. I changed its required roles from ContactsUser to ContactsStaff.
Changed logging behaviour¶
I slightly changed some details of the logging behaviour:
On my development machine I have a runserver script which does:
set LINO_LOGLEVEL=DEBUG python manage.py runserver
Unsaved Évènement 1 (14.12.2021) conflicts with …¶
Unsaved Évènement 1 (14.12.2021) conflicts with Évènement #29650 5 (05.08.2016 09:00), Évènement #29653 8 (16.09.2016 09:00), Évènement #29654 9 (30.09.2016 09:00), Évènement #29655 10 (14.10.2016 09:00), Évènement #29657 12 (18.11.2016 09:00), Évènement #29658 13 (02.12.2016 09:00).