-
Notifications
You must be signed in to change notification settings - Fork 2
Not showing meta-analysis experiments in creating score set dropdown menu. #347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
d464740
66ff1d9
c740d6b
66140c3
eb8bc0d
4301d32
f36bfdb
b81f19d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,45 +43,6 @@ | |
| ) | ||
|
|
||
|
|
||
| # TODO: Rewrite this function. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets retain this function-- I think it still has utility for just listing all experiments.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure. I'll modify it so that we don't need to send the weird q to it.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is ok to just leave it as is for this PR so we can get it released. We can just handle it at some point later-- it isn't hurting anything right now. |
||
| @router.get( | ||
| "/experiments/", | ||
| status_code=200, | ||
| response_model=list[experiment.Experiment], | ||
| response_model_exclude_none=True, | ||
| ) | ||
| def list_experiments( | ||
| *, | ||
| editable: Optional[bool] = None, | ||
| q: Optional[str] = None, | ||
| db: Session = Depends(deps.get_db), | ||
| user_data: Optional[UserData] = Depends(get_current_user), | ||
| ) -> list[Experiment]: | ||
| """ | ||
| List experiments. | ||
| """ | ||
| query = db.query(Experiment) | ||
| if q is not None: | ||
| save_to_logging_context({"query_string": q}) | ||
|
|
||
| if user_data is None or user_data.user is None: | ||
| logger.debug(msg="User is anonymous; Cannot list their experiments.", extra=logging_context()) | ||
| return [] | ||
|
|
||
| if len(q) > 0: | ||
| logger.debug(msg="Listing experiments for the current user.", extra=logging_context()) | ||
| query = query.filter( | ||
| Experiment.created_by_id == user_data.user.id | ||
| ) # .filter(Experiment.published_date is None) | ||
| # else: | ||
| # query = query.filter(Experiment.created_by_id == user.id).filter(Experiment.published_date is None) | ||
| else: | ||
| logger.debug(msg="No query string was provided; Listing all experiments.", extra=logging_context()) | ||
|
|
||
| items = query.order_by(Experiment.urn).all() | ||
| return items | ||
|
|
||
|
|
||
| @router.post( | ||
| "/experiments/search", | ||
| status_code=200, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.