Changeset View
Changeset View
Standalone View
Standalone View
swh/web/misc/origin_save.py
# Copyright (C) 2018-2019 The Software Heritage developers | # Copyright (C) 2018-2019 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU Affero General Public License version 3, or any later version | # License: GNU Affero General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
import json | import json | ||||
from django.conf.urls import url | from django.conf.urls import url | ||||
from django.core.paginator import Paginator | from django.core.paginator import Paginator | ||||
from django.http import ( | from django.http import ( | ||||
HttpResponse, HttpResponseForbidden, HttpResponseServerError | HttpResponse, HttpResponseForbidden, HttpResponseServerError | ||||
) | ) | ||||
from django.shortcuts import render | from django.shortcuts import render | ||||
from rest_framework.decorators import api_view, authentication_classes | from rest_framework.decorators import api_view, authentication_classes | ||||
from swh.web.api.throttling import throttle_scope | |||||
from swh.web.common.exc import ForbiddenExc | from swh.web.common.exc import ForbiddenExc | ||||
from swh.web.common.models import SaveOriginRequest | from swh.web.common.models import SaveOriginRequest | ||||
from swh.web.common.origin_save import ( | from swh.web.common.origin_save import ( | ||||
create_save_origin_request, get_savable_visit_types, | create_save_origin_request, get_savable_visit_types, | ||||
get_save_origin_requests_from_queryset | get_save_origin_requests_from_queryset | ||||
) | ) | ||||
from swh.web.common.throttling import throttle_scope | |||||
from swh.web.common.utils import EnforceCSRFAuthentication | from swh.web.common.utils import EnforceCSRFAuthentication | ||||
def _origin_save_view(request): | def _origin_save_view(request): | ||||
return render(request, 'misc/origin-save.html', | return render(request, 'misc/origin-save.html', | ||||
{'heading': ('Request the saving of a software origin into ' | {'heading': ('Request the saving of a software origin into ' | ||||
'the archive')}) | 'the archive')}) | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |