Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More

noi4 : A minimal Noi

This was created for the tests.test_forget_me unit test, which requires contacts and uploads. It also shows the lino.modlib.users.with_phone option.

>>> from lino_book.projects.noi4.startup import *
>>> rt.show(uploads.Uploads, display_mode='grid')
==== ===================================================== ==================== ============= ============= =============
 ID   Description                                           File                 Upload type   Uploaded by   Attached to
---- ----------------------------------------------------- -------------------- ------------- ------------- -------------
 3    Found on 2026-03-07 by uploads.UploadsFolderChecker   uploads/orphan.txt                 Robin Rood
 2    screenshot-toolbar.png                                                                   Robin Rood
 1    Screenshot 20250124 104858.png                                                           Robin Rood
==== ===================================================== ==================== ============= ============= =============

The admin_main.html calls get_welcome_messages. This code inserts the “welcome messages” for this user on this site. On noi4, this the only welcome message is “Your email address (demo@example.com) is not verified…” because :data:lino.modlib.users.allow_online_registration` is True

>>> dd.plugins.users.allow_online_registration
True
>>> ar = rt.login("robin")
>>> print(tostring(settings.SITE.get_welcome_messages(ar)))
...
Your email address (demo@example.com) is not verified, please check your mailbox
and <a href="…" title="Ask for the verification code you have received by email
and mark your email address as verified.">verify now</a> or <a href="…">re-send
our welcome email</a>.

It also shows the lino.modlib.users.with_phone option:

>>> rt.show(users.AllUsers)
========== ===================== ============ =========== ================== =======
 Username   User type             First name   Last name   e-mail address     Phone
---------- --------------------- ------------ ----------- ------------------ -------
 robin      900 (Administrator)   Robin        Rood        demo@example.com
 rolf       900 (Administrator)   Rolf         Rompen      demo@example.com
 romain     900 (Administrator)   Romain       Raffault    demo@example.com
========== ===================== ============ =========== ================== =======
>>> dbhash.check_virgin()