mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-27 20:04:06 +00:00
11 lines
328 B
Python
11 lines
328 B
Python
from django.shortcuts import get_object_or_404
|
|
from django.http import HttpResponseRedirect
|
|
|
|
from scrapyorg.download.models import DownloadLink
|
|
|
|
|
|
def toggle_public(request, link_id):
|
|
link = get_object_or_404(DownloadLink, pk=link_id)
|
|
link.toggle_public()
|
|
return HttpResponseRedirect("/admin/download/downloadlink/")
|