Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def update_entry(id):
title = request.form['title']
content = request.form['content']
_entry = Entry.update(title, content, id)
name = _entry['slug']
create_time = _entry['create_time']
status = _entry['status']
if status == 'draft':
# delete old file
os.remove(os.path.join('./summer/_draft/', name + '.md'))
# create new file
filepath = os.path.join('./summer/_draft/', name + '.md')
else:
# delete old file
os.remove(os.path.join('./summer/post/', name + '.md'))
# create new file