()
Dashbaord User Preferences:
    This will allow a user to change user preferences, i.e. Password
Dashbaord User Preferences:
    This will allow a user to change user preferences, i.e. Password
Dashbaord User Preferences : This will allow a user to change user preferences i . e . Password
def userpref_page():
    '''
    Dashbaord User Preferences:
    This will allow a user to change user preferences, i.e. Password
    '''
    verify = verifyLogin(
        app.config['SECRET_KEY'], app.config['COOKIE_TIMEOUT'], request.cookies)
    if verify:
        user = User()
        user.config = app.config
        user.get('uid', verify, g.rdb_conn)
        data = startData(user)
        data['active'] = 'dashboard'
        if user.status != "active":
            data['url'] = '/dashboard/mod-subscription'
            tmpl = 'member/mod-subscription.html'
        else:
            # Start processing the change password form
            form = ChangePassForm(request.form)
            if request.method == 'POST':
                if form.validate():
                    result = user.checkPass(form.old_password.data, g.rdb_conn)
                    if result:
                        update = user.setPass(form.password.data, g.rdb_conn)
                        if update:
                            print("/dashboard/user-preferences - Password changed")
                            flash('Password successfully changed.', 'success')
                        else:
                            print("/dashboard/user-preferences - \
                                  Password change failed")
                            flash('Password change was unsuccessful.', 'danger')
                    else:
                        print("/login - User change password error: wrong old password")
                        flash('Old password does not seem valid.', 'danger')
            data['url'] = '/dashboard/user-preferences'
            tmpl = 'member/user-preferences.html'
        page = render_template(tmpl, data=data, form=form)
        return page
    else:
        flash('Please Login.', 'warning')
        return redirect(url_for('user.login_page'))
def userpref_page ( ) : verify = verifyLogin ( app . config [ 'SECRET_KEY' ] , app . config [ 'COOKIE_TIMEOUT' ] , request . cookies ) if verify : user = User ( ) user . config = app . config user . get ( 'uid' , verify , g . rdb_conn ) data = startData ( user ) data [ 'active' ] = 'dashboard' if user . status != "active" : data [ 'url' ] = '/dashboard/mod-subscription' tmpl = 'member/mod-subscription.html' else : # Start processing the change password form form = ChangePassForm ( request . form ) if request . method == 'POST' : if form . validate ( ) : result = user . checkPass ( form . old_password . data , g . rdb_conn ) if result : update = user . setPass ( form . password . data , g . rdb_conn ) if update : print ( "/dashboard/user-preferences - Password changed" ) flash ( 'Password successfully changed.' , 'success' ) else : print ( "/dashboard/user-preferences - \
                                  Password change failed" ) flash ( 'Password change was unsuccessful.' , 'danger' ) else : print ( "/login - User change password error: wrong old password" ) flash ( 'Old password does not seem valid.' , 'danger' ) data [ 'url' ] = '/dashboard/user-preferences' tmpl = 'member/user-preferences.html' page = render_template ( tmpl , data = data , form = form ) return page else : flash ( 'Please Login.' , 'warning' ) return redirect ( url_for ( 'user.login_page' ) )