cubicweb #2329133 TypeError: add_eid_restriction() takes exactly 3 arguments (4 given) [done]

After upgrading to cubicweb 3.14.7 I get

# cubicweb-ctl upgrade app

Upgrading the instance app
-------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.6/dist-packages/cubicweb/cwctl.py", line 165, in run_arg
  status = cmdmeth(appid)
File "/usr/lib/python2.6/dist-packages/cubicweb/cwctl.py", line 734, in upgrade_instance
  mih = config.migration_handler()
File "/usr/lib/python2.6/dist-packages/cubicweb/server/serverconfig.py", line 344, in migration_handler
  verbosity=verbosity)
File "/usr/lib/python2.6/dist-packages/cubicweb/server/migractions.py", line 109, in __init__
  self.session.data['rebuild-infered'] = False
File "/usr/lib/python2.6/dist-packages/cubicweb/migration.py", line 130, in __getattribute__
  return object.__getattribute__(self, name)
File "/usr/lib/python2.6/dist-packages/cubicweb/server/migractions.py", line 305, in session
  session = self.repo._get_session(self.cnx.sessionid)
File "/usr/lib/python2.6/dist-packages/cubicweb/migration.py", line 130, in __getattribute__
  return object.__getattribute__(self, name)
File "/usr/lib/python2.6/dist-packages/cubicweb/server/migractions.py", line 283, in cnx
  self._cnx = repo_connect(self.repo, login, password=pwd)
File "/usr/lib/python2.6/dist-packages/cubicweb/dbapi.py", line 124, in repo_connect
  cnxid = repo.connect(unicode(login), **kwargs)
File "/usr/lib/python2.6/dist-packages/cubicweb/server/repository.py", line 737, in connect
  user = self.authenticate_user(session, login, **kwargs)
File "/usr/lib/python2.6/dist-packages/cubicweb/server/repository.py", line 453, in authenticate_user
  cwuser = self._build_user(session, eid)
File "/usr/lib/python2.6/dist-packages/cubicweb/server/repository.py", line 463, in _build_user
  st.add_eid_restriction(st.get_variable('X'), 'x', 'Substitute')
TypeError: add_eid_restriction() takes exactly 3 arguments (4 given)
instance app not upgraded: add_eid_restriction() takes exactly 3 arguments (4 given)
prioritynormal
typebug
done in<not specified>
load left0.000
closed by<not specified>