Update form for an account
354938
@RequestMapping(value = "{accountId}/update", method = RequestMethod.GET)
    public Form getUpdateForm(@PathVariable ID accountId) {
        Account account = accountService.getAccount(accountId);
        Form form = getCreationForm();
        // Name in read-only mode for the default admin
        if (account.isDefaultAdmin()) {
            form = form.with(Form.defaultNameField().readOnly());
        }
        // Password not filled in, and not required on update
        form = form.with(Password.of("password").label("Password").length(40).help("Password for the account. Leave blank to keep it unchanged.").optional());
        // Groups
        form = form.with(
                MultiSelection.of("groups").label("Groups")
                        .items(accountService.getAccountGroupsForSelection(accountId))
        );
        // OK
        return form
                .fill("name", account.getName())
                .fill("fullName", account.getFullName())
                .fill("email", account.getEmail())
                ;
    }
1360411
def update_subscription(request, ident):
    ""
    
    try:
        subscription = Subscription.objects.get(ident=ident)
    except Subscription.DoesNotExist:
        return respond('overseer/invalid_subscription_token.html', {}, request)

    if request.POST:
        form = UpdateSubscriptionForm(request.POST, instance=subscription)
        if form.is_valid():
            if form.cleaned_data['unsubscribe']:
                subscription.delete()
        
                return respond('overseer/unsubscribe_confirmed.html', {
                    'email': subscription.email,
                })
            else:
                form.save()

            return HttpResponseRedirect(request.get_full_path())
    else:
        form = UpdateSubscriptionForm(instance=subscription)
        
    context = csrf(request)
    context.update({
        'form': form,
        'subscription': subscription,
        'service_list': Service.objects.all(),
    })

    return respond('overseer/update_subscription.html', context, request)
505308
function create(req, res, next) {
  var options = req.connectionOptions;
  req.user = req.user || {};
  var params = {
    userEmail: req.user.email || req.body.updatedBy
  };

  options = _.extend(options, params);

  logger.debug("Middleware: create form: ", {options: options});

  forms.updateForm(options, req.body, formsResultHandlers(constants.resultTypes.forms, req, next));
}
430007
def update_customer(self, customer_id, **kwargs):
		""""""
		body = self._formdata(kwargs, FastlyCustomer.FIELDS)
		content = self._fetch("/customer/%s" % customer_id, method="PUT", body=body)
		return FastlyCustomer(self, content)
845973
def users_update(self, user_id, **kwargs):
        """"""
        return self.__call_api_post('users.update', userId=user_id, data=kwargs)
1116549
function updateAccount() {

  account.middleName = 'Make it so.';

  return account.save(function(err, savedAccount) {
    if (err) throw err;
    account = savedAccount;
    console.log('Updated account:');
    console.log(account);
    return authenticateAccount(); //next quickstart step
  });

}
1221724
def update_info(self, _action=None, **kwargs):
        

        def cb():
            kwargs.pop("email", None)
            kwargs.pop("username", None)
            kwargs.pop("password_hash", None)
            kwargs.pop("require_password_change", None)
            self.user.update(**kwargs)
            return kwargs

        _action = ACTIONS["UPDATE"] if _action is None else _action
        return signals.user_update(self, _action, cb, data=self.to_dict())
1109543
def update(self, uid: str, patch=False, data: any = {}) -> typing.Union[str, dict]:
        
        methodType = 'put' if patch is False else 'patch'
        return self.__client.request(methodType, '/forms/%s' % uid, data=data)
1289709
def update(self, request, id):
        """"""
        try:
            object = self.model.objects.get(id=id)
        except self.model.DoesNotExist:
            return self._render(
                request = request,
                template = '404',
                context = {
                    'error': 'The %s could not be found.' % self.model.__name__.lower()
                },
                status = 404,
                prefix_template_path = False
            )

        fields = []
        for field in request.PATCH:

            try:
                self.model._meta.get_field_by_name(field)
            except FieldDoesNotExist:
                continue
            else:
                fields.append(field)

        Form = generate_form(
            model = self.model,
            form = self.form,
            fields = fields
        )

        form = Form(request.PATCH, instance=object)
        if form.is_valid():
            object = form.save()

            return self.show(request, id)
        else:
            return self._render(
                request = request,
                template = 'edit',
                context = {
                    'form': form
                },
                status = 400
            )
1319808
function updateForms(params, validDataSources, invalidDataSources, cb) {
  //Only interested In Data Sources Where Data Was Actually Updated. If the data set is still the same, then no need to mark the form as updated the form.
  var dataSoucesUpdated = _.filter(validDataSources, function(dataSourceData) {
    return dataSourceData.dataChanged === true;
  });

  //Updating Any Forms That Reference Updated Data Sources
  var updatedDataSourceIds = _.map(dataSoucesUpdated, function(validDataSourceData) {
    return validDataSourceData._id;
  });

  //Need to find and update any forms associated with the data sources.
  var Form = models.get(params.connections.mongooseConnection, models.MODELNAMES.FORM);

  //Flagging Any Forms That Are Using The Updated Data Sources As Being Updated. This is useful for client/cloud apps that need to determine if they need to load the entire form again.
  Form.update({
    "dataSources.formDataSources": {"$in": updatedDataSourceIds}
  }, {
    "$set": {
      "dataSources.lastRefresh": params.currentTime
    }
  }, { multi: true }, function(err) {
    if (err) {
      return cb(buildErrorResponse({
        error: new Error("Error Updating Forms Refresh Fields"),
        code: ERROR_CODES.FH_FORMS_UNEXPECTED_ERROR
      }));
    }

    //No error, forms updated, moving on
    cb(undefined, validDataSources, invalidDataSources);
  });
}
610138
def handle_profile_form(form):
    """"""
    form.process(formdata=request.form)

    if form.validate_on_submit():
        email_changed = False
        with db.session.begin_nested():
            # Update profile.
            current_userprofile.username = form.username.data
            current_userprofile.full_name = form.full_name.data
            db.session.add(current_userprofile)

            # Update email
            if current_app.config['USERPROFILES_EMAIL_ENABLED'] and \
               form.email.data != current_user.email:
                current_user.email = form.email.data
                current_user.confirmed_at = None
                db.session.add(current_user)
                email_changed = True
        db.session.commit()

        if email_changed:
            send_confirmation_instructions(current_user)
            # NOTE: Flash message after successful update of profile.
            flash(_('Profile was updated. We have sent a verification '
                    'email to %(email)s. Please check it.',
                    email=current_user.email),
                  category='success')
        else:
            # NOTE: Flash message after successful update of profile.
            flash(_('Profile was updated.'), category='success')
1293382
def edit_form(self, obj):
        """"""
        form = super(OAISetModelView, self).edit_form(obj)
        del form.spec
        return form
776173
def update_email(strategy, details, user=None, *args, **kwargs):
    """"""
    if user:
        email = details.get('email')

        if email and user.email != email:
            user.email = email
            strategy.storage.user.changed(user)
80725
public function updateItemEditForm(Form $form)
    {
        $record = $this->owner->getRecord();

        if ($this->shouldDisplayAction($record)) {
            $restoreToRoot = RestoreAction::shouldRestoreToRoot($record);

            $title = $restoreToRoot
                ? _t('SilverStripe\\Versioned\\RestoreAction.RESTORE_TO_ROOT', 'Restore to draft at top level')
                : _t('SilverStripe\\Versioned\\RestoreAction.RESTORE', 'Restore to draft');
            $description = $restoreToRoot
                ? _t(
                    'SilverStripe\\Versioned\\RestoreAction.RESTORE_TO_ROOT_DESC',
                    'Restore the archived version to draft as a top level item'
                )
                : _t(
                    'SilverStripe\\Versioned\\RestoreAction.RESTORE_DESC',
                    'Restore the archived version to draft'
                );

            $form->actions = FieldList::create(
                FormAction::create('doRestore', $title)
                    ->setDescription($description)
                    ->setAttribute('data-to-root', $restoreToRoot)
                    ->addExtraClass('btn-warning font-icon-back-in-time ArchiveAdmin__action--restore')
                    ->setUseButtonTag(true)
            );

            $form->unsetValidator();
        }
    }
491157
def update(gandi, email, password, quota, fallback, alias_add, alias_del):
    """"""
    options = {}

    if password:
        password = click.prompt('password', hide_input=True,
                                confirmation_prompt=True)
        options['password'] = password

    if quota is not None:
        options['quota'] = quota

    if fallback is not None:
        options['fallback_email'] = fallback

    login, domain = email

    result = gandi.mail.update(domain, login, options, alias_add, alias_del)

    return result
506613
def account_settings_update(self, data, **kwargs):
        ""
        api_path = "/api/v2/account/settings.json"
        return self.call(api_path, method="PUT", data=data, **kwargs)
101699
private String updateAccount(Long userId) {
    String email = get("mail");
    String pwd = get("password");
    Map<String, Object> valueMap = CollectUtils.newHashMap();
    valueMap.put("password", pwd);
    valueMap.put("mail", email);
    entityDao.update(User.class, "id", new Object[] { userId }, valueMap);
    return redirect("infolet", "ok.passwordChanged", "&id=" + userId);
  }