def validateSetting(request, person): form = UserView.generate_setting_form(request, person) if not form.errors: saveSettings(person, form) file = request.files['image'] if file.filename: if not UserManager.change_picture(person, file): return "Error with the picture" return UserView.display_settings(person, form) else: return UserView.display_settings(person, form)
def saveSettings(person, form): if form.password.data and not form.password.errors: UserManager.change_password(person, form.password.data) if form.image.data and not form.image.errors: UserManager.change_picture() UserManager.update_from_form(person, form) # UserManager.change_info(person, # form.birthdate.data, # form.sex.data, # form.weight.data, # form.height.data, # form.firstname, # form.lastname, # ) return
def checkStreakController(todayDate, person, fitnessInfo): return UserManager.checkStreakController(todayDate=todayDate, person=person, fitnessInfo=fitnessInfo)
def validateStepsData(request, person): return UserManager.update_steps_ajax(person=person, form=request.form)