def post(self, request, *args, **kwargs):
        domain_form = DomainForm(request.POST)
        # Try to create the domain. Catch all exceptions.
        try:
            domain = domain_form.save()
        except ValueError:
            return render(request, "mozdns/mozdns_form.html", {
                'form': domain_form,
                'form_title': 'Create Domain'
            })

        try:
            if domain.master_domain and domain.master_domain.soa:
                domain.soa = domain.master_domain.soa
                domain.save()
        except __HOLE__:
            return render(request, "mozdns/mozdns_form.html", {'form':
                          domain_form, 'form_title': 'Create Domain'})
        # Success. Redirect.
        messages.success(request, "{0} was successfully created.".
                         format(domain.name))
        return redirect(domain)
dataset/ETHPy150Open mozilla/inventory/mozdns/domain/views.py/DomainCreateView.post