def remove_user(): """Remove user **Example request** .. sourcecode:: http POST /removeUsername HTTP/1.1 { "token": "<token>" } **Example response** .. sourcecode:: http HTTP/1.1 200 OK Content-Encoding: gzip Content-Type: application/json Server: nginx/1.1.19 Vary: Accept-Encoding { "status": "OK", "message": "Username removed successfully" } :jsonparam string token: Authentication token :statuscode 200: no error """ current_user.delete() return make_response(message='Username removed successfully')
def remove_user(): """Remove user **Example request** .. sourcecode:: http POST /removeUsername HTTP/1.1 { "token": "<token>" } **Example response** .. sourcecode:: http HTTP/1.1 200 OK Content-Encoding: gzip Content-Type: application/json Server: nginx/1.1.19 Vary: Accept-Encoding { "status": "OK", "message": "Username removed successfully" } :jsonparam string token: Authentication token :statuscode 200: no error """ current_user.delete() return make_response(message='Username removed successfully')
def deactivateAccount(): # Delete profile picture if current_user.img != DEFAULT_PROFILE_PIC: subprocess.call("rm -f photos/%s" % str(current_user.img), shell=True) # Delete user from database current_user.delete() logout_user() flash("Account has been deactivated!") return redirect(url_for('index'))
def delete_profile(): form = DeleteProfileForm() if form.validate_on_submit(): current_user.delete() logout_user() flash('Your monkey profile was successfully deleted', 'success') redirect(url_for('index')) return render_template('delete_profile.html', form=form)
def deactivateAccount(): # Delete profile picture deleteProfilePic(current_user.img) # Grab user images imgs = getUserImages(current_user) # Delete user from database current_user.delete() # Delete images in the photos folder handleUserImageDeletion(imgs) # Logout User logout_user() flash("Account has been deactivated!") return redirect(url_for('index'))
def delete(): current_user.delete() return logout()