2020-07-28 03:26:45 +00:00
|
|
|
__package__ = 'archivebox.core'
|
|
|
|
|
|
|
|
from io import StringIO
|
2021-02-16 20:47:49 +00:00
|
|
|
from pathlib import Path
|
2020-07-28 03:26:45 +00:00
|
|
|
from contextlib import redirect_stdout
|
|
|
|
|
2019-04-02 20:36:41 +00:00
|
|
|
from django.contrib import admin
|
2020-07-28 03:26:45 +00:00
|
|
|
from django.urls import path
|
2020-06-30 09:56:17 +00:00
|
|
|
from django.utils.html import format_html
|
2020-07-28 09:59:54 +00:00
|
|
|
from django.utils.safestring import mark_safe
|
2020-07-28 03:56:35 +00:00
|
|
|
from django.shortcuts import render, redirect
|
2020-07-28 03:26:45 +00:00
|
|
|
from django.contrib.auth import get_user_model
|
2020-10-12 18:47:03 +00:00
|
|
|
from django import forms
|
2019-04-02 20:36:41 +00:00
|
|
|
|
2021-01-21 00:02:31 +00:00
|
|
|
from ..util import htmldecode, urldecode, ansi_to_html
|
2021-01-20 23:44:28 +00:00
|
|
|
|
2021-02-16 11:13:27 +00:00
|
|
|
from core.models import Snapshot, ArchiveResult, Tag
|
2020-10-12 18:47:03 +00:00
|
|
|
from core.forms import AddLinkForm, TagField
|
2020-07-28 03:26:45 +00:00
|
|
|
|
2020-11-17 23:42:57 +00:00
|
|
|
from core.mixins import SearchResultsAdminMixin
|
|
|
|
|
2020-11-28 07:12:27 +00:00
|
|
|
from index.html import snapshot_icons
|
2020-07-28 10:50:03 +00:00
|
|
|
from logging_util import printable_filesize
|
|
|
|
from main import add, remove
|
2021-02-16 01:42:00 +00:00
|
|
|
from config import OUTPUT_DIR, SNAPSHOTS_PER_PAGE
|
2020-07-28 10:50:03 +00:00
|
|
|
from extractors import archive_links
|
2020-06-30 09:56:17 +00:00
|
|
|
|
2021-01-30 10:35:17 +00:00
|
|
|
# Admin URLs
|
|
|
|
# /admin/
|
|
|
|
# /admin/login/
|
|
|
|
# /admin/core/
|
|
|
|
# /admin/core/snapshot/
|
|
|
|
# /admin/core/snapshot/:uuid/
|
|
|
|
# /admin/core/tag/
|
|
|
|
# /admin/core/tag/:uuid/
|
|
|
|
|
|
|
|
|
2020-06-30 09:56:17 +00:00
|
|
|
# TODO: https://stackoverflow.com/questions/40760880/add-custom-button-to-django-admin-panel
|
2019-04-27 21:26:24 +00:00
|
|
|
|
2019-04-22 17:20:19 +00:00
|
|
|
|
2020-10-12 18:47:03 +00:00
|
|
|
class SnapshotAdminForm(forms.ModelForm):
|
|
|
|
tags = TagField(required=False)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = Snapshot
|
|
|
|
fields = "__all__"
|
|
|
|
|
|
|
|
def save(self, commit=True):
|
|
|
|
# Based on: https://stackoverflow.com/a/49933068/3509554
|
|
|
|
|
|
|
|
# Get the unsave instance
|
|
|
|
instance = forms.ModelForm.save(self, False)
|
|
|
|
tags = self.cleaned_data.pop("tags")
|
|
|
|
|
|
|
|
#update save_m2m
|
|
|
|
def new_save_m2m():
|
|
|
|
instance.save_tags(tags)
|
|
|
|
|
|
|
|
# Do we need to save all changes now?
|
|
|
|
self.save_m2m = new_save_m2m
|
|
|
|
if commit:
|
|
|
|
instance.save()
|
|
|
|
|
|
|
|
return instance
|
|
|
|
|
2021-02-16 20:47:49 +00:00
|
|
|
class ArchiveResultInline(admin.TabularInline):
|
|
|
|
model = ArchiveResult
|
|
|
|
|
2021-02-18 07:32:58 +00:00
|
|
|
from django.contrib.admin.helpers import ActionForm
|
|
|
|
|
|
|
|
|
|
|
|
class SnapshotActionForm(ActionForm):
|
|
|
|
tag = forms.ModelChoiceField(queryset=Tag.objects.all(), required=False)
|
|
|
|
# pass
|
|
|
|
|
2020-10-12 18:47:03 +00:00
|
|
|
|
2020-11-17 23:42:57 +00:00
|
|
|
class SnapshotAdmin(SearchResultsAdminMixin, admin.ModelAdmin):
|
2020-07-30 03:54:26 +00:00
|
|
|
list_display = ('added', 'title_str', 'url_str', 'files', 'size')
|
|
|
|
sort_fields = ('title_str', 'url_str', 'added')
|
2021-02-16 20:47:49 +00:00
|
|
|
readonly_fields = ('id', 'num_outputs', 'is_archived', 'url_hash', 'added', 'updated')
|
2021-01-31 01:40:10 +00:00
|
|
|
search_fields = ['url__icontains', 'timestamp', 'title', 'tags__name']
|
2021-02-16 20:47:49 +00:00
|
|
|
fields = (*readonly_fields, 'timestamp', 'url', 'title', 'tags')
|
2020-06-30 09:56:17 +00:00
|
|
|
list_filter = ('added', 'updated', 'tags')
|
|
|
|
ordering = ['-added']
|
2021-02-18 07:32:58 +00:00
|
|
|
actions = ['delete_snapshots', 'overwrite_snapshots', 'update_snapshots', 'update_titles', 'verify_snapshots', 'add_tag', 'remove_tag']
|
2020-10-12 18:47:03 +00:00
|
|
|
form = SnapshotAdminForm
|
2021-02-16 01:42:00 +00:00
|
|
|
list_per_page = SNAPSHOTS_PER_PAGE
|
2021-02-16 20:47:49 +00:00
|
|
|
inlines = [ArchiveResultInline]
|
2020-06-30 09:56:17 +00:00
|
|
|
|
2021-02-18 07:32:58 +00:00
|
|
|
action_form = SnapshotActionForm
|
|
|
|
|
2020-12-12 04:03:46 +00:00
|
|
|
def get_urls(self):
|
|
|
|
urls = super().get_urls()
|
|
|
|
custom_urls = [
|
|
|
|
path('grid/', self.admin_site.admin_view(self.grid_view),name='grid')
|
|
|
|
]
|
|
|
|
return custom_urls + urls
|
|
|
|
|
2020-09-21 16:50:26 +00:00
|
|
|
def get_queryset(self, request):
|
2021-02-18 07:32:58 +00:00
|
|
|
self.request = request
|
2020-09-21 16:50:26 +00:00
|
|
|
return super().get_queryset(request).prefetch_related('tags')
|
|
|
|
|
|
|
|
def tag_list(self, obj):
|
2020-09-24 20:11:17 +00:00
|
|
|
return ', '.join(obj.tags.values_list('name', flat=True))
|
2020-09-21 16:50:26 +00:00
|
|
|
|
2021-02-18 07:32:58 +00:00
|
|
|
# TODO: figure out a different way to do this, you cant nest forms so this doenst work
|
|
|
|
# def action(self, obj):
|
|
|
|
# # csrfmiddlewaretoken: Wa8UcQ4fD3FJibzxqHN3IYrrjLo4VguWynmbzzcPYoebfVUnDovon7GEMYFRgsh0
|
|
|
|
# # action: update_snapshots
|
|
|
|
# # select_across: 0
|
|
|
|
# # _selected_action: 76d29b26-2a88-439e-877c-a7cca1b72bb3
|
|
|
|
# return format_html(
|
|
|
|
# '''
|
|
|
|
# <form action="/admin/core/snapshot/" method="post" onsubmit="e => e.stopPropagation()">
|
|
|
|
# <input type="hidden" name="csrfmiddlewaretoken" value="{}">
|
|
|
|
# <input type="hidden" name="_selected_action" value="{}">
|
|
|
|
# <button name="update_snapshots">Check</button>
|
|
|
|
# <button name="update_titles">Pull title + favicon</button>
|
|
|
|
# <button name="update_snapshots">Update</button>
|
|
|
|
# <button name="overwrite_snapshots">Re-Archive (overwrite)</button>
|
|
|
|
# <button name="delete_snapshots">Permanently delete</button>
|
|
|
|
# </form>
|
|
|
|
# ''',
|
|
|
|
# csrf.get_token(self.request),
|
|
|
|
# obj.id,
|
|
|
|
# )
|
|
|
|
|
2020-06-30 09:56:17 +00:00
|
|
|
def id_str(self, obj):
|
|
|
|
return format_html(
|
|
|
|
'<code style="font-size: 10px">{}</code>',
|
|
|
|
obj.url_hash[:8],
|
|
|
|
)
|
|
|
|
|
|
|
|
def title_str(self, obj):
|
|
|
|
canon = obj.as_link().canonical_outputs()
|
2020-07-28 09:59:54 +00:00
|
|
|
tags = ''.join(
|
2020-10-31 11:55:27 +00:00
|
|
|
format_html('<a href="/admin/core/snapshot/?tags__id__exact={}"><span class="tag">{}</span></a> ', tag.id, tag)
|
2020-09-21 16:50:26 +00:00
|
|
|
for tag in obj.tags.all()
|
2020-10-31 11:55:27 +00:00
|
|
|
if str(tag).strip()
|
2020-10-07 15:15:56 +00:00
|
|
|
)
|
2020-06-30 09:56:17 +00:00
|
|
|
return format_html(
|
|
|
|
'<a href="/{}">'
|
2020-07-28 03:26:45 +00:00
|
|
|
'<img src="/{}/{}" class="favicon" onerror="this.remove()">'
|
2020-06-30 09:56:17 +00:00
|
|
|
'</a>'
|
2020-08-18 13:17:21 +00:00
|
|
|
'<a href="/{}/index.html">'
|
2020-07-28 03:26:45 +00:00
|
|
|
'<b class="status-{}">{}</b>'
|
|
|
|
'</a>',
|
2020-06-30 09:56:17 +00:00
|
|
|
obj.archive_path,
|
2020-07-27 23:29:57 +00:00
|
|
|
obj.archive_path, canon['favicon_path'],
|
2020-08-18 13:17:21 +00:00
|
|
|
obj.archive_path,
|
2020-07-28 03:26:45 +00:00
|
|
|
'fetched' if obj.latest_title or obj.title else 'pending',
|
2020-07-28 09:59:54 +00:00
|
|
|
urldecode(htmldecode(obj.latest_title or obj.title or ''))[:128] or 'Pending...'
|
2020-10-31 11:55:27 +00:00
|
|
|
) + mark_safe(f' <span class="tags">{tags}</span>')
|
2020-06-30 09:56:17 +00:00
|
|
|
|
|
|
|
def files(self, obj):
|
2020-11-28 07:12:27 +00:00
|
|
|
return snapshot_icons(obj)
|
2020-07-27 23:29:57 +00:00
|
|
|
|
|
|
|
def size(self, obj):
|
2021-02-16 20:51:17 +00:00
|
|
|
archive_size = (Path(obj.link_dir) / 'index.html').exists() and obj.archive_size
|
2020-10-31 11:56:19 +00:00
|
|
|
if archive_size:
|
|
|
|
size_txt = printable_filesize(archive_size)
|
|
|
|
if archive_size > 52428800:
|
|
|
|
size_txt = mark_safe(f'<b>{size_txt}</b>')
|
|
|
|
else:
|
2020-10-31 23:32:43 +00:00
|
|
|
size_txt = mark_safe('<span style="opacity: 0.3">...</span>')
|
2020-07-27 23:29:57 +00:00
|
|
|
return format_html(
|
|
|
|
'<a href="/{}" title="View all files">{}</a>',
|
2020-06-30 09:56:17 +00:00
|
|
|
obj.archive_path,
|
2020-10-31 11:56:19 +00:00
|
|
|
size_txt,
|
2020-06-30 09:56:17 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
def url_str(self, obj):
|
|
|
|
return format_html(
|
2020-10-31 23:32:43 +00:00
|
|
|
'<a href="{}"><code>{}</code></a>',
|
2020-06-30 09:56:17 +00:00
|
|
|
obj.url,
|
2020-06-30 10:41:48 +00:00
|
|
|
obj.url.split('://www.', 1)[-1].split('://', 1)[-1][:64],
|
2020-06-30 09:56:17 +00:00
|
|
|
)
|
2019-04-22 17:20:19 +00:00
|
|
|
|
2020-12-12 04:03:46 +00:00
|
|
|
def grid_view(self, request):
|
|
|
|
|
|
|
|
# cl = self.get_changelist_instance(request)
|
|
|
|
|
|
|
|
# Save before monkey patching to restore for changelist list view
|
|
|
|
saved_change_list_template = self.change_list_template
|
|
|
|
saved_list_per_page = self.list_per_page
|
|
|
|
saved_list_max_show_all = self.list_max_show_all
|
|
|
|
|
|
|
|
# Monkey patch here plus core_tags.py
|
2021-01-30 10:35:07 +00:00
|
|
|
self.change_list_template = 'private_index_grid.html'
|
2020-12-12 04:03:46 +00:00
|
|
|
self.list_per_page = 20
|
|
|
|
self.list_max_show_all = self.list_per_page
|
|
|
|
|
|
|
|
# Call monkey patched view
|
|
|
|
rendered_response = self.changelist_view(request)
|
|
|
|
|
|
|
|
# Restore values
|
|
|
|
self.change_list_template = saved_change_list_template
|
|
|
|
self.list_per_page = saved_list_per_page
|
|
|
|
self.list_max_show_all = saved_list_max_show_all
|
|
|
|
|
|
|
|
return rendered_response
|
2021-02-18 07:32:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
def update_snapshots(modeladmin, request, queryset):
|
|
|
|
archive_links([
|
|
|
|
snapshot.as_link()
|
|
|
|
for snapshot in queryset
|
|
|
|
], out_dir=OUTPUT_DIR)
|
|
|
|
update_snapshots.short_description = "Archive"
|
|
|
|
|
|
|
|
def update_titles(modeladmin, request, queryset):
|
|
|
|
archive_links([
|
|
|
|
snapshot.as_link()
|
|
|
|
for snapshot in queryset
|
|
|
|
], overwrite=True, methods=('title','favicon'), out_dir=OUTPUT_DIR)
|
|
|
|
update_titles.short_description = "Pull title"
|
|
|
|
|
|
|
|
def overwrite_snapshots(modeladmin, request, queryset):
|
|
|
|
archive_links([
|
|
|
|
snapshot.as_link()
|
|
|
|
for snapshot in queryset
|
|
|
|
], overwrite=True, out_dir=OUTPUT_DIR)
|
|
|
|
overwrite_snapshots.short_description = "Re-archive (overwrite)"
|
|
|
|
|
|
|
|
def verify_snapshots(modeladmin, request, queryset):
|
|
|
|
for snapshot in queryset:
|
|
|
|
print(snapshot.timestamp, snapshot.url, snapshot.is_archived, snapshot.archive_size, len(snapshot.history))
|
|
|
|
|
|
|
|
verify_snapshots.short_description = "Check"
|
|
|
|
|
|
|
|
def delete_snapshots(modeladmin, request, queryset):
|
|
|
|
remove(snapshots=queryset, yes=True, delete=True, out_dir=OUTPUT_DIR)
|
|
|
|
|
|
|
|
delete_snapshots.short_description = "Delete"
|
|
|
|
|
|
|
|
def add_tag(modeladmin, request, queryset):
|
|
|
|
tag = request.POST['tag']
|
|
|
|
for obj in queryset:
|
|
|
|
obj.tags.add(tag)
|
|
|
|
|
|
|
|
add_tag.short_description = "Add tag"
|
|
|
|
|
|
|
|
def remove_tag(modeladmin, request, queryset):
|
|
|
|
tag = request.POST['tag']
|
|
|
|
for obj in queryset:
|
|
|
|
obj.tags.remove(tag)
|
|
|
|
|
|
|
|
remove_tag.short_description = "Remove tag"
|
|
|
|
|
2020-12-12 04:03:46 +00:00
|
|
|
|
|
|
|
|
2020-06-30 09:56:17 +00:00
|
|
|
id_str.short_description = 'ID'
|
|
|
|
title_str.short_description = 'Title'
|
2020-07-28 03:26:45 +00:00
|
|
|
url_str.short_description = 'Original URL'
|
2019-04-22 17:20:19 +00:00
|
|
|
|
2020-06-30 09:56:17 +00:00
|
|
|
id_str.admin_order_field = 'id'
|
|
|
|
title_str.admin_order_field = 'title'
|
|
|
|
url_str.admin_order_field = 'url'
|
2019-04-23 01:40:42 +00:00
|
|
|
|
2021-02-18 07:32:58 +00:00
|
|
|
|
|
|
|
|
2020-10-31 11:55:27 +00:00
|
|
|
class TagAdmin(admin.ModelAdmin):
|
2021-02-18 07:32:58 +00:00
|
|
|
list_display = ('slug', 'name', 'num_snapshots', 'snapshots', 'id')
|
2020-10-31 11:55:27 +00:00
|
|
|
sort_fields = ('id', 'name', 'slug')
|
2021-02-18 07:32:58 +00:00
|
|
|
readonly_fields = ('id', 'num_snapshots', 'snapshots')
|
2020-10-31 11:55:27 +00:00
|
|
|
search_fields = ('id', 'name', 'slug')
|
|
|
|
fields = (*readonly_fields, 'name', 'slug')
|
2021-02-18 07:32:58 +00:00
|
|
|
actions = ['delete_selected']
|
|
|
|
|
|
|
|
def num_snapshots(self, obj):
|
|
|
|
return format_html(
|
|
|
|
'<a href="/admin/core/snapshot/?tags__id__exact={}">{} total</a>',
|
|
|
|
obj.id,
|
|
|
|
obj.snapshot_set.count(),
|
|
|
|
)
|
|
|
|
|
|
|
|
def snapshots(self, obj):
|
|
|
|
total_count = obj.snapshot_set.count()
|
|
|
|
return mark_safe('<br/>'.join(
|
|
|
|
format_html(
|
|
|
|
'{} <code><a href="/admin/core/snapshot/{}/change"><b>[{}]</b></a> {}</code>',
|
|
|
|
snap.updated.strftime('%Y-%m-%d %H:%M'),
|
|
|
|
snap.id,
|
|
|
|
snap.timestamp,
|
|
|
|
snap.url,
|
|
|
|
)
|
|
|
|
for snap in obj.snapshot_set.order_by('-updated')[:10]
|
|
|
|
) + (f'<br/><a href="/admin/core/snapshot/?tags__id__exact={obj.id}">and {total_count-10} more...<a>' if obj.snapshot_set.count() > 10 else ''))
|
|
|
|
return
|
|
|
|
|
2020-07-28 03:26:45 +00:00
|
|
|
|
2021-02-16 11:13:27 +00:00
|
|
|
class ArchiveResultAdmin(admin.ModelAdmin):
|
2021-02-16 20:47:49 +00:00
|
|
|
list_display = ('id', 'start_ts', 'extractor', 'snapshot_str', 'cmd_str', 'status', 'output_str')
|
2021-02-16 11:13:27 +00:00
|
|
|
sort_fields = ('start_ts', 'extractor', 'status')
|
2021-02-16 20:47:49 +00:00
|
|
|
readonly_fields = ('id', 'uuid', 'snapshot_str')
|
|
|
|
search_fields = ('id', 'uuid', 'snapshot__url', 'extractor', 'output', 'cmd_version', 'cmd', 'snapshot__timestamp')
|
2021-02-18 07:32:58 +00:00
|
|
|
fields = (*readonly_fields, 'snapshot', 'snapshot__tags', 'extractor', 'status', 'start_ts', 'end_ts', 'pwd', 'cmd', 'cmd_version', 'output')
|
2021-02-16 20:47:49 +00:00
|
|
|
|
|
|
|
list_filter = ('status', 'extractor', 'start_ts', 'cmd_version')
|
|
|
|
ordering = ['-start_ts']
|
|
|
|
list_per_page = SNAPSHOTS_PER_PAGE
|
|
|
|
|
|
|
|
def snapshot_str(self, obj):
|
|
|
|
return format_html(
|
|
|
|
'<a href="/archive/{}/index.html"><b><code>[{}]</code></b></a><br/>'
|
|
|
|
'<small>{}</small>',
|
|
|
|
obj.snapshot.timestamp,
|
|
|
|
obj.snapshot.timestamp,
|
|
|
|
obj.snapshot.url[:128],
|
|
|
|
)
|
|
|
|
|
|
|
|
def cmd_str(self, obj):
|
|
|
|
return format_html(
|
|
|
|
'<pre>{}</pre>',
|
|
|
|
' '.join(obj.cmd) if isinstance(obj.cmd, list) else str(obj.cmd),
|
|
|
|
)
|
|
|
|
|
|
|
|
def output_str(self, obj):
|
|
|
|
return format_html(
|
2021-02-18 07:32:58 +00:00
|
|
|
'<a href="/archive/{}/{}" class="output-link">↗️</a><pre>{}</pre>',
|
2021-02-16 20:47:49 +00:00
|
|
|
obj.snapshot.timestamp,
|
|
|
|
obj.output if (obj.status == 'succeeded') and obj.extractor not in ('title', 'archive_org') else 'index.html',
|
|
|
|
obj.output,
|
|
|
|
)
|
2021-02-16 11:13:27 +00:00
|
|
|
|
2021-02-16 20:47:49 +00:00
|
|
|
snapshot_str.short_description = 'snapshot'
|
2020-07-28 03:26:45 +00:00
|
|
|
|
|
|
|
class ArchiveBoxAdmin(admin.AdminSite):
|
|
|
|
site_header = 'ArchiveBox'
|
|
|
|
index_title = 'Links'
|
|
|
|
site_title = 'Index'
|
|
|
|
|
|
|
|
def get_urls(self):
|
|
|
|
return [
|
2020-07-28 03:56:35 +00:00
|
|
|
path('core/snapshot/add/', self.add_view, name='Add'),
|
2020-07-28 03:26:45 +00:00
|
|
|
] + super().get_urls()
|
|
|
|
|
|
|
|
def add_view(self, request):
|
2020-07-28 03:56:35 +00:00
|
|
|
if not request.user.is_authenticated:
|
|
|
|
return redirect(f'/admin/login/?next={request.path}')
|
|
|
|
|
2020-07-28 03:26:45 +00:00
|
|
|
request.current_app = self.name
|
|
|
|
context = {
|
|
|
|
**self.each_context(request),
|
|
|
|
'title': 'Add URLs',
|
|
|
|
}
|
|
|
|
|
|
|
|
if request.method == 'GET':
|
|
|
|
context['form'] = AddLinkForm()
|
|
|
|
|
|
|
|
elif request.method == 'POST':
|
|
|
|
form = AddLinkForm(request.POST)
|
|
|
|
if form.is_valid():
|
|
|
|
url = form.cleaned_data["url"]
|
|
|
|
print(f'[+] Adding URL: {url}')
|
|
|
|
depth = 0 if form.cleaned_data["depth"] == "0" else 1
|
|
|
|
input_kwargs = {
|
|
|
|
"urls": url,
|
|
|
|
"depth": depth,
|
|
|
|
"update_all": False,
|
|
|
|
"out_dir": OUTPUT_DIR,
|
|
|
|
}
|
|
|
|
add_stdout = StringIO()
|
|
|
|
with redirect_stdout(add_stdout):
|
|
|
|
add(**input_kwargs)
|
|
|
|
print(add_stdout.getvalue())
|
|
|
|
|
|
|
|
context.update({
|
|
|
|
"stdout": ansi_to_html(add_stdout.getvalue().strip()),
|
|
|
|
"form": AddLinkForm()
|
|
|
|
})
|
|
|
|
else:
|
|
|
|
context["form"] = form
|
|
|
|
|
2021-01-30 10:35:07 +00:00
|
|
|
return render(template_name='add.html', request=request, context=context)
|
2020-07-28 03:26:45 +00:00
|
|
|
|
|
|
|
admin.site = ArchiveBoxAdmin()
|
|
|
|
admin.site.register(get_user_model())
|
2019-05-01 03:44:51 +00:00
|
|
|
admin.site.register(Snapshot, SnapshotAdmin)
|
2020-10-31 11:55:27 +00:00
|
|
|
admin.site.register(Tag, TagAdmin)
|
2021-02-16 11:13:27 +00:00
|
|
|
admin.site.register(ArchiveResult, ArchiveResultAdmin)
|
2020-07-28 09:51:02 +00:00
|
|
|
admin.site.disable_action('delete_selected')
|