def edit_app(domain): app = Application.get(domain=domain, author=warden.current_user()) form = EditAppForm(request.form, name=app.domain, description=app.description) if form.validate_on_submit(): file = request.files['zipfile'] if zipfile.is_zipfile(file): with zipfile.ZipFile(file) as _zipfile: os.umask(022) path2appfiles = apps_files_path(app.author.nickname, app.domain) _zipfile.extractall(path2appfiles) return render_template('developer/edit_app.html', form=form)
def validate_domain(self, field): app = Application.get(domain=field.data, author=warden.current_user()) if app: raise ValidationError("Domain already taken")
def app_details(domain): app = Application.get(domain=domain, author=warden.current_user()) return render_template('developer/app_details.html', app=app)
def details(nickname, domain): app = Application.get(domain, nickname) return render_template('appstore/details.html', app=app)