@login_required
@one_perm_required_or_403(pr_project_private_perm,
    (Project, 'slug__exact', 'project_slug'))
def get_pot_file(request, project_slug, resource_slug):
    resource = get_object_or_404(
        Resource, project__slug=project_slug, slug=resource_slug
    )
    try:
        fb = FormatsBackend(resource, None)
        template = fb.compile_translation()
    except Exception, e:
        messages.error(request, _("Error compiling the pot file."))
        logger.error(
            "Error compiling the pot file for %s: %s" % (resource, e)
        )
        return HttpResponseRedirect(reverse(
                'resource_detail', args=[resource.project.slug, resource.slug]
        ))
    response = HttpResponse(
        template, mimetype=registry.mimetypes_for(resource.i18n_method)[0]
    )
    _filename = "%(proj)s_%(res)s.pot" % {
        'proj': smart_unicode(resource.project.slug),
        'res': smart_unicode(resource.slug),
    }
    response['Content-Disposition'] = ('attachment; filename=%s' % _filename)
    return response


# Restrict access only to : (The checks are done in the view's body)
# 1)those belonging to the specific language team (coordinators or members)
# 2)project maintainers
# 3)global submitters (perms given through access control tab)
# 4)superusers
Sets a cookie.
dataset/ETHPy150Open rvanlaar/easy-transifex/src/transifex/transifex/resources/views.py/get_pot_file--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.3/django/http/__init__.py/HttpResponse.set_cookie