1
1
Fork 0

Image upload bugfix, post source word-break style

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

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

@ -130,13 +130,14 @@ def upload():
form = UploadForm(request.form)
if request.method == 'POST' and form.validate():
file = request.files.get(form.post_img.name)
file.seek(0)
file.save(post.image_files['image'])
f_tags = form.tags.data.split()
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()
db.session.add(post)

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