dbapi.py
changeset 9396 e83cbc116352
parent 9309 cd45a1cc9b38
parent 9355 19ab31ea6ffb
child 9402 2c48c091b6a2
child 9701 46c8d8701240
equal deleted inserted replaced
9395:96dba2efd16d 9396:e83cbc116352
   268     """return a new anonymous session
   268     """return a new anonymous session
   269 
   269 
   270     raises an AuthenticationError if anonymous usage is not allowed
   270     raises an AuthenticationError if anonymous usage is not allowed
   271     """
   271     """
   272     anoninfo = vreg.config.anonymous_user()
   272     anoninfo = vreg.config.anonymous_user()
   273     if anoninfo is None: # no anonymous user
   273     if anoninfo[0] is None: # no anonymous user
   274         raise AuthenticationError('anonymous access is not authorized')
   274         raise AuthenticationError('anonymous access is not authorized')
   275     anon_login, anon_password = anoninfo
   275     anon_login, anon_password = anoninfo
   276     # use vreg's repository cache
   276     # use vreg's repository cache
   277     repo = vreg.config.repository(vreg)
   277     repo = vreg.config.repository(vreg)
   278     anon_cnx = _repo_connect(repo, anon_login, password=anon_password)
   278     anon_cnx = _repo_connect(repo, anon_login, password=anon_password)