def form_valid(self, form): org = self.request.user.get_org() data = form.cleaned_data self.object = Channel.add_authenticated_external_channel(org, self.request.user, self.get_submitted_country(data), data['number'], data['username'], data['password'], 'JNU', data.get('url'), role=Channel.ROLE_USSD) if data['secret']: self.object.secret = data['secret'] self.object.save() return super(AuthenticatedExternalClaimView, self).form_valid(form)
def form_valid(self, form): org = self.request.user.get_org() data = form.cleaned_data config = {Channel.CONFIG_CALLBACK_DOMAIN: org.get_brand_domain()} if data['secret']: config[Channel.CONFIG_SECRET] = data['secret'] self.object = Channel.add_authenticated_external_channel(org, self.request.user, self.get_submitted_country(data), data['number'], data['username'], data['password'], 'JN', data.get('url'), role=Channel.DEFAULT_ROLE, extra_config=config) return super(AuthenticatedExternalClaimView, self).form_valid(form)
def form_valid(self, form): org = self.request.user.get_org() data = form.cleaned_data config = None if data['secret']: config = {Channel.CONFIG_SECRET: data['secret']} self.object = Channel.add_authenticated_external_channel( org, self.request.user, self.get_submitted_country(data), data['number'], data['username'], data['password'], 'JNU', data.get('url'), extra_config=config, role=Channel.ROLE_USSD) return super(AuthenticatedExternalClaimView, self).form_valid(form)
def form_valid(self, form): org = self.request.user.get_org() data = form.cleaned_data config = {Channel.CONFIG_CALLBACK_DOMAIN: org.get_brand_domain()} if data["secret"]: config[Channel.CONFIG_SECRET] = data["secret"] self.object = Channel.add_authenticated_external_channel( org, self.request.user, self.get_submitted_country(data), data["number"], data["username"], data["password"], "JN", data.get("url"), role=Channel.DEFAULT_ROLE, extra_config=config, ) return super(AuthenticatedExternalClaimView, self).form_valid(form)
def form_valid(self, form): org = self.request.user.get_org() data = form.cleaned_data config = None if data["secret"]: config = {Channel.CONFIG_SECRET: data["secret"]} self.object = Channel.add_authenticated_external_channel( org, self.request.user, self.get_submitted_country(data), data["number"], data["username"], data["password"], "JNU", data.get("url"), extra_config=config, role=Channel.ROLE_USSD, ) return super(AuthenticatedExternalClaimView, self).form_valid(form)