def settings_form(self): language_choices = langcodes.get_all_langs_for_select() from corehq.apps.users.forms import UpdateMyAccountInfoForm if self.request.method == 'POST': form = UpdateMyAccountInfoForm(self.request.POST) else: form = UpdateMyAccountInfoForm() form.initialize_form(existing_user=self.request.couch_user) form.load_language(language_choices) return form
def settings_form(self): language_choices = langcodes.get_all_langs_for_select() api_key_status, api_key_exists = self.get_api_key_status() from corehq.apps.users.forms import UpdateMyAccountInfoForm try: domain = self.request.domain except AttributeError: domain = '' if self.request.method == 'POST': form = UpdateMyAccountInfoForm( self.request.POST, api_key_status=api_key_status, api_key_exists=api_key_exists, domain=domain, existing_user=self.request.couch_user, ) else: form = UpdateMyAccountInfoForm( api_key_status=api_key_status, api_key_exists=api_key_exists, domain=domain, existing_user=self.request.couch_user, ) form.load_language(language_choices) return form
def settings_form(self): language_choices = langcodes.get_all_langs_for_select() api_key = self.get_or_create_api_key() from corehq.apps.users.forms import UpdateMyAccountInfoForm try: domain = self.request.domain except AttributeError: domain = '' if self.request.method == 'POST': form = UpdateMyAccountInfoForm( self.request.POST, api_key=api_key, domain=domain, existing_user=self.request.couch_user, ) else: form = UpdateMyAccountInfoForm( api_key=api_key, domain=domain, existing_user=self.request.couch_user, ) form.load_language(language_choices) return form
def settings_form(self): language_choices = langcodes.get_all_langs_for_select() api_key = self.get_or_create_api_key() from corehq.apps.users.forms import UpdateMyAccountInfoForm if self.request.method == 'POST': form = UpdateMyAccountInfoForm(self.request.POST, user=self.request.couch_user, api_key=api_key) else: form = UpdateMyAccountInfoForm(user=self.request.couch_user, api_key=api_key) try: domain = self.request.domain except AttributeError: domain = '' form.initialize_form(domain, existing_user=self.request.couch_user) form.load_language(language_choices) return form
def settings_form(self): language_choices = langcodes.get_all_langs_for_select() api_key = self.get_or_create_api_key() from corehq.apps.users.forms import UpdateMyAccountInfoForm if self.request.method == "POST": form = UpdateMyAccountInfoForm( self.request.POST, username=self.request.couch_user.username, api_key=api_key ) else: form = UpdateMyAccountInfoForm(username=self.request.couch_user.username, api_key=api_key) try: domain = self.request.domain except AttributeError: domain = "" form.initialize_form(domain, existing_user=self.request.couch_user) form.load_language(language_choices) return form