Skip to content

Commit

Permalink
Merge pull request #61 from tinyerp/saas-connect
Browse files Browse the repository at this point in the history
do not prevent login when access to Client.db.list() is denied
  • Loading branch information
florentx committed Sep 23, 2014
2 parents 277d93b + 077f33d commit 3c65b36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Changelog
* Remove the ``search+name_get`` undocumented feature which has
wrong behavior when applied to an empty ``RecordList``.

* Do not prevent login if access to ``Client.db.list()`` is denied.


1.6b1 (2014-06-09)
~~~~~~~~~~~~~~~~~~
Expand Down
12 changes: 8 additions & 4 deletions erppeek.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,14 @@ def login(self, user, password=None, database=None):
If the `password` is not available, it will be asked.
"""
if database:
dbs = self.db.list()
if database not in dbs:
raise Error("Database '%s' does not exist: %s" %
(database, dbs))
try:
dbs = self.db.list()
except Fault:
pass # AccessDenied: simply ignore this check
else:
if database not in dbs:
raise Error("Database '%s' does not exist: %s" %
(database, dbs))
if not self._db:
self._db = database
# Used for logging, copied from openerp.sql_db.db_connect
Expand Down

0 comments on commit 3c65b36

Please sign in to comment.