def create(): authz.require(authz.dataset_create()) if app.config.get('DATASET_CREATION_DISABLED'): raise Forbidden("Sorry, dataset creation is disabled") dataset = Dataset.create(request_data(), request.account) db.session.commit() return redirect(url_for('.view', dataset=dataset.name))
def create(): authz.require(authz.dataset_create()) data = request_content() try: dataset = Dataset.create(data, request.account) db.session.commit() return redirect(url_for('.view', dataset=dataset.name)) except Invalid, inv: return handle_invalid(inv, new, data=data)
def create(): authz.require(authz.dataset_create()) dataset = Dataset.create(request_data(), request.account) db.session.commit() return redirect(url_for('.view', dataset=dataset.name))
def new(): authz.require(authz.dataset_create()) return render_template('dataset/new.html')