Esempio n. 1
0
    def post(self, request, *args, **kwargs):
        reverse_domain_form = ReverseDomainForm(request.POST)

        # Try to create the reverse_domain. Catch all exceptions.
        try:
            reverse_domain = reverse_domain_form.save(commit=False)
        except ValueError, e:
            return render(request, "cydns/cydns_form.html", {
                'form': reverse_domain_form,
                'form_title': 'Create Reverse Domain'
            })
Esempio n. 2
0
    def post(self, request, *args, **kwargs):
        reverse_domain_form = ReverseDomainForm(request.POST)
        # Try to create the reverse_domain. Catch all exceptions.
        try:
            reverse_domain = reverse_domain_form.save(commit=False)
            if (reverse_domain_form.cleaned_data['inherit_soa'] and
                reverse_domain.master_reverse_domain):
                reverse_domain.soa = reverse_domain.master_reverse_domain.soa

            reverse_domain.save()
        except ValidationError, e:
            return render(request, "cydns/cydns_form.html", {
                            'form': reverse_domain_form,
                            'form_title': 'Create Reverse Domain'
                        })