Example #1
0
    def post(self, preprocessed_data_id):
        # make sure user is admin and can therefore actually submit to VAMPS
        if self.current_user.level != 'admin':
            raise HTTPError(
                403, "User %s cannot submit to VAMPS!" % self.current_user.id)
        msg = ''
        msg_level = 'success'
        preprocessed_data = Artifact(preprocessed_data_id)
        state = preprocessed_data.submitted_to_vamps_status()

        demux = [
            path for _, path, ftype in preprocessed_data.get_filepaths()
            if ftype == 'preprocessed_demux'
        ]
        demux_length = len(demux)

        if state in ('submitting', 'success'):
            msg = "Cannot resubmit! Current state is: %s" % state
            msg_level = 'danger'
        elif demux_length != 1:
            msg = "The study doesn't have demux files or have too many" % state
            msg_level = 'danger'
        else:
            channel = self.current_user.id
            job_id = submit(channel, submit_to_VAMPS,
                            int(preprocessed_data_id))

            self.render('compute_wait.html',
                        job_id=job_id,
                        title='VAMPS Submission',
                        completion_redirect='/compute_complete/%s' % job_id)
            return

        self.display_template(preprocessed_data_id, msg, msg_level)
Example #2
0
    def post(self, preprocessed_data_id):
        # make sure user is admin and can therefore actually submit to VAMPS
        if self.current_user.level != "admin":
            raise HTTPError(403, "User %s cannot submit to VAMPS!" % self.current_user.id)
        msg = ""
        msg_level = "success"
        preprocessed_data = Artifact(preprocessed_data_id)
        state = preprocessed_data.submitted_to_vamps_status()

        demux = [path for _, path, ftype in preprocessed_data.get_filepaths() if ftype == "preprocessed_demux"]
        demux_length = len(demux)

        if state in ("submitting", "success"):
            msg = "Cannot resubmit! Current state is: %s" % state
            msg_level = "danger"
        elif demux_length != 1:
            msg = "The study doesn't have demux files or have too many" % state
            msg_level = "danger"
        else:
            channel = self.current_user.id
            job_id = submit(channel, submit_to_VAMPS, int(preprocessed_data_id))

            self.render(
                "compute_wait.html",
                job_id=job_id,
                title="VAMPS Submission",
                completion_redirect="/compute_complete/%s" % job_id,
            )
            return

        self.display_template(preprocessed_data_id, msg, msg_level)
Example #3
0
    @authenticated
    def get(self, preprocessed_data_id):
        self.display_template(preprocessed_data_id, "", "")

    @authenticated
    @execute_as_transaction
    def post(self, preprocessed_data_id):
        # make sure user is admin and can therefore actually submit to VAMPS
<<<<<<< HEAD
        if self.current_user.level != 'admin':
            raise HTTPError(403, "User %s cannot submit to VAMPS!" %
                            self.current_user.id)
        msg = ''
        msg_level = 'success'
        preprocessed_data = Artifact(preprocessed_data_id)
        state = preprocessed_data.submitted_to_vamps_status()

        demux = [path for _, path, ftype in preprocessed_data.get_filepaths()
                 if ftype == 'preprocessed_demux']
        demux_length = len(demux)

        if state in ('submitting',  'success'):
            msg = "Cannot resubmit! Current state is: %s" % state
            msg_level = 'danger'
        elif demux_length != 1:
            msg = "The study doesn't have demux files or have too many" % state
            msg_level = 'danger'
        else:
            channel = self.current_user.id
            job_id = submit(channel, submit_to_VAMPS,
                            int(preprocessed_data_id))