def _process(self): form = UserDetailsForm(obj=FormDefaults(self.user, skip_attrs={'title'}, title=self.user._title), synced_fields=self.user.synced_fields, synced_values=self.user.synced_values) if form.validate_on_submit(): self.user.synced_fields = form.synced_fields form.populate_obj(self.user, skip=self.user.synced_fields) self.user.synchronize_data(refresh=True) flash(_('Your personal data was successfully updated.'), 'success') return redirect(url_for('.user_profile')) return WPUser.render_template('personal_data.html', 'personal_data', user=self.user, form=form)
def _process(self): form = UserDetailsForm(obj=FormDefaults(self.user, skip_attrs={'title'}, title=self.user._title), synced_fields=self.user.synced_fields, synced_values=self.user.synced_values) if form.validate_on_submit(): self.user.synced_fields = form.synced_fields form.populate_obj(self.user, skip=self.user.synced_fields) self.user.synchronize_data(refresh=True) flash(_('Your personal data was successfully updated.'), 'success') return redirect(url_for('.user_profile')) from_dt = now_utc(False) - relativedelta(years=100, weeks=1, hour=0, minute=0, second=0) linked_events = [event for event, roles in get_linked_events(self.user, from_dt, 10).iteritems()] return WPUser.render_template('contributions.html', 'contributions', user=self.user, form=form, now_utc=now_utc(False), linked_events=linked_events, gua = get_user_abstracts)