Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def publish_draft(id):
status = request.form['status']
entry = Entry.update_status(id, status)
slug = entry['slug']
draft_file = os.path.join('./summer/_draft/', slug + '.md')
post_file = os.path.join('./summer/post/', slug + '.md')
if status == 'publish':
os.rename(draft_file, post_file)
elif status == 'draft':
os.rename(post_file, draft_file)
return jsonify(r=True)