def create_no_system_static_interface(request):
    if request.method == "POST":
        interface_form = FullStaticInterfaceForm(request.POST)
        try:
            if not interface_form.is_valid():
                return render(request, 'core/core_form.html', {
                    'form': interface_form,
                })

            intr = interface_form.save()
        except ValidationError, e:
            interface_form._errors['__all__'] = ErrorList(e.messages)
            return render(request, 'core/core_form.html', {
                'form': interface_form,
            })

        return redirect(intr.system.get_absolute_url())

    else:
        initial = {}
        if 'ip_type' in request.GET and 'ip_str' in request.GET:
            ip_str = request.GET['ip_str']
            ip_type = request.GET['ip_type']
            network = calc_parent_str(ip_str, ip_type)
            if network and network.vlan and network.site:
                expected_name = "{0}.{1}.mozilla.com".format(
                    network.vlan.name, network.site.get_site_path())
                try:
                    domain = Domain.objects.get(name=expected_name)
                except ObjectDoesNotExist, e:
                    domain = None

            if domain:
                initial['initial'] = {'ip_str': ip_str, 'domain': domain,
                                      'ip_type': ip_type}
            else:
                initial['initial'] = {'ip_str': ip_str, 'ip_type': ip_type}

        interface_form = FullStaticInterfaceForm(**initial)

        return render(request, 'core/core_form.html', {
            'form': interface_form,
        })
dataset/ETHPy150Open rtucker-mozilla/mozilla_inventory/core/interface/static_intr/views.py/create_no_system_static_interface/original