From 350ab12fc449353705e9e837fe4c8b947e8a7173 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Wed, 2 Mar 2022 21:45:42 +0100 Subject: [PATCH] Do not load gallery on API access --- photologue/static/lightgallery/plugins/admin/lg-admin.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/photologue/static/lightgallery/plugins/admin/lg-admin.js b/photologue/static/lightgallery/plugins/admin/lg-admin.js index 3faef11..1fbdd8f 100644 --- a/photologue/static/lightgallery/plugins/admin/lg-admin.js +++ b/photologue/static/lightgallery/plugins/admin/lg-admin.js @@ -50,6 +50,7 @@ class lgAdmin { data.append('csrfmiddlewaretoken', this.csrfToken); fetch(`/photo/${this.photoId}/delete/`, { method: "POST", + redirect: "manual", // do not load gallery again body: data, credentials: 'same-origin', }).then(res => { @@ -74,6 +75,7 @@ class lgAdmin { data.append('csrfmiddlewaretoken', this.csrfToken); fetch(`/photo/${this.photoId}/report/`, { method: "POST", + redirect: "manual", // do not load gallery again body: data, credentials: 'same-origin', }).then(res => {