Skip to content

Commit

Permalink
fix activating project by id hiding errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jthurner committed Jul 4, 2023
1 parent f40324e commit 4b3b66a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pandahub/lib/PandaHub.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,9 @@ def set_active_project(self, project_name, realm=None):
self.set_active_project_by_id(project_id)

def set_active_project_by_id(self, project_id):
try:
self.active_project = self._get_project_document({"_id": ObjectId(project_id)})
except:
self.active_project = self._get_project_document({"_id": project_id})
if not isinstance(project_id, ObjectId):
project_id = ObjectId(project_id)
self.active_project = self._get_project_document({"_id": project_id})

def rename_project(self, project_name):
self.has_permission("write")
Expand Down

0 comments on commit 4b3b66a

Please sign in to comment.