def user_update(request): form = forms.UserUpdate(request, request.user) if request.method == 'POST' and form.processPostData(request.POST): form.saveValues() request.db.commit() request.session.flash('Angaben geändert', queue='messages') return {'form': form}
def user_check(request): form = forms.UserUpdate(request, request.user) if request.method == 'POST' and form.processPostData(request.POST): has_updated = request.db.query(models.UserHasUpdated).get(request.user.id) if has_updated is None: has_updated = models.UserHasUpdated(request.user.id, '0') has_updated.has_updated_info = muesli.utils.getSemesterLimit() if not has_updated in request.db: request.db.add(has_updated) request.db.commit() form.saveValues() request.db.commit() request.session.flash('Angaben geändert', queue='messages') return {'form': form}