1
1
Fork 0

Image upload bugfix, post source word-break style

dev
Jan Kužílek 5 years ago
parent 5435bcc5ee
commit 0cdd93606f

@ -69,6 +69,10 @@
flex-flow: column nowrap; flex-flow: column nowrap;
font-size: .9em; font-size: .9em;
.source > a {
word-break: break-all;
}
> img { > img {
display: block; display: block;
max-width: 128px; max-width: 128px;

@ -130,13 +130,14 @@ def upload():
form = UploadForm(request.form) form = UploadForm(request.form)
if request.method == 'POST' and form.validate(): if request.method == 'POST' and form.validate():
file = request.files.get(form.post_img.name) file = request.files.get(form.post_img.name)
file.seek(0)
file.save(post.image_files['image'])
f_tags = form.tags.data.split() f_tags = form.tags.data.split()
tags = Tag.query.filter(Tag.content.in_(f_tags)).all() tags = Tag.query.filter(Tag.content.in_(f_tags)).all()
post = Post(file, **Post.fileinfo(file), source=form.sauce.data, tags=tags, rating=form.rating.data, author=current_user) post = Post(**Post.fileinfo(file), source=form.sauce.data, tags=tags, rating=form.rating.data, author=current_user)
file.seek(0)
file.save(post.image_files['image'])
post.generate_image_files() post.generate_image_files()
db.session.add(post) db.session.add(post)

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save