Exemple #1
0
def form_delete_person_submitted():
    submission = request.forms.get('name')
    submission = submission.split(':')
    userRole = submission[0]
    userName = submission[1]
    remove_person(userName, userRole)
    redirect('/')
Exemple #2
0
def form_edit_person_submitted():
    submission = request.forms.get('name')
    submission = submission.split(':')
    userRole = submission[0]
    userName = submission[1]
    originalUserName = submission[1]
    remove_person(userName, userRole)
    if request.forms.get('new_name'):
        userName = request.forms.get('new_name')
    if request.forms.get('new_role'):
        userRole = request.forms.get('new_role')

    replace_user_data(originalUserName, userName)

    redirect('/add/' + userName + '/' + userRole)