pyramid-cubicweb #14244045 start cubicweb application even when anon user is not present in database [open]

If the configuration points to an anon user and the anon user is not in the database, pyramid-cubicweb doesn't start the application and traceback

Traceback (most recent call last):
File "/home/logidemo/grshell-pasl/cubicweb/cwctl.py", line 146, in run_arg
  status = cmdmeth(appid)
File "/home/logidemo/grshell-pasl/cubes/pyramid/ccplugin.py", line 327, in pyramid_instance
  profile_dump_every=self['profile-dump-every']
File "/home/logidemo/grshell-pasl/pyramid-cubicweb/pyramid_cubicweb/__init__.py", line 66, in wsgi_application_from_cwconfig
  config = make_cubicweb_application(cwconfig)
File "/home/logidemo/grshell-pasl/pyramid-cubicweb/pyramid_cubicweb/__init__.py", line 48, in make_cubicweb_application
  config.include('pyramid_cubicweb')
File "/usr/lib/python2.7/dist-packages/pyramid/config/__init__.py", line 755, in include
  c(configurator)
File "/home/logidemo/grshell-pasl/pyramid-cubicweb/pyramid_cubicweb/__init__.py", line 180, in includeme
  config.include('pyramid_cubicweb.core')
File "/usr/lib/python2.7/dist-packages/pyramid/config/__init__.py", line 755, in include
  c(configurator)
File "/home/logidemo/grshell-pasl/pyramid-cubicweb/pyramid_cubicweb/core.py", line 385, in includeme
  'CWUser', login=login).one().eid
File "/home/logidemo/grshell-pasl/cubicweb/rset.py", line 458, in one
  raise NoResultError("No row was found for one()")
NoResultError: No row was found for one()
instance bahf not None: No row was found for one()

It would be nicer to switch to authenticated mode when anon user is not present in database. I'm not sure we want to protect the admin from deleting the anon user.

prioritynormal
typebug
done in<not specified>
closed by<not specified>