|
|
@ -94,9 +94,9 @@ def modify_user():
|
|
|
|
elif form.edit.data:
|
|
|
|
elif form.edit.data:
|
|
|
|
# if form.username.data: el.username = form.username.data
|
|
|
|
# if form.username.data: el.username = form.username.data
|
|
|
|
|
|
|
|
|
|
|
|
if form.email.data: el.email = form.email.data
|
|
|
|
if form.email.raw_data and form.email.data: el.email = form.email.data
|
|
|
|
if form.user_status.data: el.user_status = form.user_status.data
|
|
|
|
if form.user_status.raw_data and form.user_status.data: el.user_status = form.user_status.data
|
|
|
|
if form.op_level.data: el.op_level = form.op_level.data
|
|
|
|
if form.op_level.raw_data and form.op_level.data: el.op_level = form.op_level.data
|
|
|
|
|
|
|
|
|
|
|
|
db.session.commit()
|
|
|
|
db.session.commit()
|
|
|
|
flash('Changes to {} have been applied.'.format(str(el)))
|
|
|
|
flash('Changes to {} have been applied.'.format(str(el)))
|
|
|
@ -124,9 +124,14 @@ def modify_post():
|
|
|
|
db.session.commit()
|
|
|
|
db.session.commit()
|
|
|
|
flash('{} deleted.'.format(str(el)))
|
|
|
|
flash('{} deleted.'.format(str(el)))
|
|
|
|
elif form.edit.data:
|
|
|
|
elif form.edit.data:
|
|
|
|
if form.rating.data: el.rating = form.rating.data
|
|
|
|
if form.rating.raw_data and form.rating.data: el.rating = form.rating.data
|
|
|
|
if form.status.data: el.status = form.status.data
|
|
|
|
if form.status.raw_data and form.status.data: el.status = form.status.data
|
|
|
|
if form.source.data: el.source = form.source.data
|
|
|
|
if form.source.raw_data and form.source.data: el.source = form.source.data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if form.tags.raw_data and form.tags.raw_data:
|
|
|
|
|
|
|
|
f_tags = form.tags.data.split()
|
|
|
|
|
|
|
|
tags = Tag.query.filter(Tag.content.in_(f_tags)).all()
|
|
|
|
|
|
|
|
el.tags = tags
|
|
|
|
|
|
|
|
|
|
|
|
db.session.commit()
|
|
|
|
db.session.commit()
|
|
|
|
flash('Changes to {} have been applied.'.format(str(el)))
|
|
|
|
flash('Changes to {} have been applied.'.format(str(el)))
|
|
|
@ -168,7 +173,7 @@ def modify_tag():
|
|
|
|
flash('{} deleted.'.format(str(el)))
|
|
|
|
flash('{} deleted.'.format(str(el)))
|
|
|
|
elif form.edit.data:
|
|
|
|
elif form.edit.data:
|
|
|
|
# if form.content.data: el.content = form.content.data
|
|
|
|
# if form.content.data: el.content = form.content.data
|
|
|
|
if form.category.data: el.category = form.category.data
|
|
|
|
if form.category.raw_data and form.category.data: el.category = form.category.data
|
|
|
|
|
|
|
|
|
|
|
|
db.session.commit()
|
|
|
|
db.session.commit()
|
|
|
|
flash('Changes to {} have been applied.'.format(str(el)))
|
|
|
|
flash('Changes to {} have been applied.'.format(str(el)))
|
|
|
@ -201,7 +206,7 @@ def modify_comment():
|
|
|
|
db.session.commit()
|
|
|
|
db.session.commit()
|
|
|
|
flash('{} deleted.'.format(str(el)))
|
|
|
|
flash('{} deleted.'.format(str(el)))
|
|
|
|
elif form.edit.data:
|
|
|
|
elif form.edit.data:
|
|
|
|
if form.content.data: el.content = form.content.data.strip()
|
|
|
|
if form.content.raw_data and form.content.data: el.content = form.content.data.strip()
|
|
|
|
|
|
|
|
|
|
|
|
db.session.commit()
|
|
|
|
db.session.commit()
|
|
|
|
flash('Changes to {} have been applied.'.format(str(el)))
|
|
|
|
flash('Changes to {} have been applied.'.format(str(el)))
|
|
|
|