Skip to content

Delete prep template #850

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

Merged
merged 11 commits into from
Feb 15, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
comment from @josenavas
  • Loading branch information
antgonza committed Feb 13, 2015
commit 9c7d91f748744e22f908029945f535bf381c0e00
7 changes: 2 additions & 5 deletions qiita_pet/handlers/study_handlers/description_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,15 +632,12 @@ def delete_prep_template(self, study, user, callback):
PrepTemplate.delete(prep_template_id)
msg = ("Prep template %d has been deleted" % prep_template_id)
msg_level = "success"
tab = 'study_information_tab'
tab_id = None
except Exception as e:
msg = ("Couldn't remove prep template: %s" % str(e))
msg_level = "danger"
tab = 'raw_data_tab'
tab_id = PrepTemplate(prep_template_id).raw_data

callback((msg, msg_level, tab, tab_id, None))
callback((msg, msg_level, 'raw_data_tab',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now is broken. If the removal worked successfully, the PrepTemplate with id prep_template_id no longer works. You just need to move the query to PrepTemplate(prep_template_id).raw_data before the try statement

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PrepTemplate(prep_template_id).raw_data, None))

@authenticated
def get(self, study_id):
Expand Down