mirror of
https://github.com/sissbruecker/linkding.git
synced 2025-08-13 13:39:27 +02:00
Make Internet Archive integration opt-in (#250)
* Make web archive integration opt-in * Add toast message about web archive integration opt-in * Improve wording for web archive setting * Add toast admin * Fix toast clear button visited styles * Add test for redirect * Improve wording * Ensure redirects to same domain * Improve wording * Fix snapshot test Co-authored-by: Sascha Ißbrücker <sascha.issbruecker@gmail.com>
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
from .bookmarks import *
|
||||
from .settings import *
|
||||
from .toasts import *
|
||||
|
19
bookmarks/views/toasts.py
Normal file
19
bookmarks/views/toasts.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.http import HttpResponseRedirect, Http404
|
||||
from django.urls import reverse
|
||||
|
||||
from bookmarks.models import Toast
|
||||
from bookmarks.utils import get_safe_return_url
|
||||
|
||||
|
||||
@login_required
|
||||
def acknowledge(request, toast_id: int):
|
||||
try:
|
||||
toast = Toast.objects.get(pk=toast_id, owner=request.user)
|
||||
except Toast.DoesNotExist:
|
||||
raise Http404('Toast does not exist')
|
||||
toast.acknowledged = True
|
||||
toast.save()
|
||||
|
||||
return_url = get_safe_return_url(request.GET.get('return_url'), reverse('bookmarks:index'))
|
||||
return HttpResponseRedirect(return_url)
|
Reference in New Issue
Block a user