mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-09-14 11:06:13 +05:00
fix: keep web add redirects on admin host
This commit is contained in:
parent
a1e518e5ab
commit
81212cb79c
@ -1412,8 +1412,15 @@ class WebAddView(AddView):
|
||||
if snapshot:
|
||||
return redirect(f"/{snapshot.url_path}")
|
||||
|
||||
request_host = (request.get_host() or "").lower()
|
||||
if (
|
||||
request.user.is_authenticated
|
||||
and not _get_request_config(request).PUBLIC_ADD_VIEW
|
||||
and host_matches(request_host, get_web_host())
|
||||
):
|
||||
return redirect(build_admin_url(request.get_full_path(), request=request))
|
||||
|
||||
if not self.test_func():
|
||||
request_host = (request.get_host() or "").lower()
|
||||
if host_matches(request_host, get_web_host()):
|
||||
return redirect(build_admin_url(request.get_full_path(), request=request))
|
||||
if host_matches(request_host, get_admin_host()):
|
||||
|
||||
@ -138,7 +138,7 @@ def test_archiveresult_admin_links_plugin_and_process():
|
||||
process_html = str(admin.process_link(result))
|
||||
|
||||
assert "/admin/environment/plugins/builtin.wget/" in plugin_html
|
||||
assert f"/admin/machine/process/{process.id}/change" in process_html
|
||||
assert f"/admin/machine/process/{process.id.hex}/change" in process_html
|
||||
|
||||
|
||||
def test_deleting_binary_and_process_records_preserves_results():
|
||||
|
||||
Loading…
Reference in New Issue
Block a user