Skip to content

Commit

Permalink
Merge pull request #266 from AmpliconSuite/issue261_263
Browse files Browse the repository at this point in the history
Issue 261 and 263
  • Loading branch information
liefeld authored Apr 19, 2024
2 parents 3ff3eca + bf148ed commit 41f5b00
Show file tree
Hide file tree
Showing 3 changed files with 196 additions and 137 deletions.
19 changes: 16 additions & 3 deletions caper/caper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,11 @@ def get_one_project(project_name_or_uuid):
except:
project = None

# look for project that has been versioned by editing and giving it a new file. This makes sure that
# the old links work

## Maybe we are looking for an updated project: look for it by checking for the "current = False" flag
if project is None:
try:
project = collection_handle.find_one({'previous_project_ids': project_name_or_uuid, 'delete': False})
project = collection_handle.find_one({'_id': ObjectId(project_name_or_uuid), 'current': False, 'delete': True})
if project is not None:
prepare_project_linkid(project)
logging.warning(f"Could not lookup project {project_name_or_uuid}, had to use previous project ids!")
Expand All @@ -231,6 +231,19 @@ def get_one_project(project_name_or_uuid):
except:
project = None

if project is None:
try:
project = collection_handle.find_one({'project_name': project_name_or_uuid, 'current': False, 'delete': True})
if project is not None:
prepare_project_linkid(project)
logging.warning(f"Could not lookup project {project_name_or_uuid}, had to use previous project ids!")

return project
except:
project = None



if project is None:
logging.error(f"Project is None for {project_name_or_uuid}")

Expand Down
Loading

0 comments on commit 41f5b00

Please sign in to comment.