@login_required
def copy_snapshot(request, snapshot):
    user = request.couch_user
    if not user.is_eula_signed():
        messages.error(request, 'You must agree to our eula to download an app')
        return HttpResponseRedirect(reverse(ProjectInformationView.urlname, args=[snapshot]))

    dom = Domain.get(snapshot)
    if request.method is "POST" and dom.is_snapshot:
        assert dom.full_applications(include_builds=False), 'Bad attempt to copy project without any apps!'

        from corehq.apps.registration.forms import DomainRegistrationForm

        args = {
            'domain_name': request.POST['new_project_name'],
            'hr_name': request.POST['new_project_name'],
            'eula_confirmed': True,
        }
        form = DomainRegistrationForm(args)

        if request.POST.get('new_project_name', ""):
            if not dom.published:
                messages.error(request, _("This project is not published and can't be downloaded"))
                return HttpResponseRedirect(reverse(ProjectInformationView.urlname, args=[snapshot]))

            if not form.is_valid():
                messages.error(request, form.errors)
                return HttpResponseRedirect(reverse(ProjectInformationView.urlname, args=[snapshot]))

            new_domain_name = name_to_url(form.cleaned_data['hr_name'], "project")
            with CriticalSection(['copy_domain_snapshot_{}_to_{}'.format(dom.name, new_domain_name)]):
                try:
                    new_domain = dom.save_copy(new_domain_name,
                                               new_hr_name=form.cleaned_data['hr_name'],
                                               user=user)
                    if new_domain.commtrack_enabled:
                        new_domain.convert_to_commtrack()

                except NameUnavailableException:
                    messages.error(request, _("A project by that name already exists"))
                    return HttpResponseRedirect(reverse(ProjectInformationView.urlname, args=[snapshot]))

            def inc_downloads(d):
                d.downloads += 1

            apply_update(dom, inc_downloads)
            messages.success(request, render_to_string("appstore/partials/view_wiki.html",
                                                       {"pre": _("Project copied successfully!")}),
                             extra_tags="html")
            return HttpResponseRedirect(reverse('view_app',
                                                args=[new_domain.name, new_domain.full_applications()[0].get_id]))
        else:
            messages.error(request, _("You must specify a name for the new project"))
            return HttpResponseRedirect(reverse(ProjectInformationView.urlname, args=[snapshot]))
    else:
        return HttpResponseRedirect(reverse(ProjectInformationView.urlname, args=[snapshot]))
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/appstore/views.py/copy_snapshot/operator `==` -> `is`