code: def oauth_register(form):
      
      if form.validate():
          data = form.to_dict()
          if not data.get('password'):
              data['password'] = ''
          user = register_user(**data)
          if not data['password']:
              user.password = None
          _datastore.commit()
          return user
docs: Register user if possible.
  
      :param form: A form instance.
      :returns: A :class:`invenio_accounts.models.User` instance.