def loading(self): result = task_result(self.session.get('task_id')) if result.ready(): if result.get().get('status') == 'Success': self.session.flash('ESGF logon was successful.', queue='success') return self.next('wizard_done') else: self.session.flash('ESGF logon failed: {}.'.format( result.get().get('message')), queue='danger') return HTTPFound(location=self.request.route_path(self.name)) return {}
def loading(self): result = task_result(self.session.get('task_id')) if result.ready(): if result.get().get('status') == 'Success': self.session.flash('ESGF logon was successful.', queue='success') return self.callback() else: msg = '<strong>Error:</strong> ESGF logon failed: {0}.'.format( escape(result.get().get('message'))) self.session.flash(msg, queue='danger') return HTTPFound(location=self.request.route_path('esgflogon')) return {}
def check_logon(self): status = 'running' result = task_result(self.session.get('task_id')) if result.ready(): status = 'ready' return dict(status=status)