summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2026-04-14 10:41:32 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2026-04-14 10:41:32 +0200
commit4d3163a588882ed0c54217fb256556be93f69d1f (patch)
tree971449842fecdf69df8b4ffece6558b258cff776
parent47c4fbec8a17b339de00d33ac5cedaf846b71ba2 (diff)
downloadIshtar-4d3163a588882ed0c54217fb256556be93f69d1f.tar.bz2
Ishtar-4d3163a588882ed0c54217fb256556be93f69d1f.zip
🚑️ admin imports: fix permissions
-rw-r--r--archaeological_files/admin.py2
-rw-r--r--ishtar_common/admin.py8
-rw-r--r--ishtar_common/models.py1
3 files changed, 6 insertions, 5 deletions
diff --git a/archaeological_files/admin.py b/archaeological_files/admin.py
index d7b0a763a..293afcd29 100644
--- a/archaeological_files/admin.py
+++ b/archaeological_files/admin.py
@@ -174,7 +174,7 @@ class CopyPriceAgreementAdmin(GeneralTypeAdmin):
def get_urls(self):
urls = super(CopyPriceAgreementAdmin, self).get_urls()
my_urls = [
- re_path(r"^copy-price-agreement/$", self.copy_price_agreement),
+ re_path(r"^copy-price-agreement/$", self.admin_site.admin_view(self.copy_price_agreement)),
]
return my_urls + urls
diff --git a/ishtar_common/admin.py b/ishtar_common/admin.py
index 8f9d4d0a9..691525c10 100644
--- a/ishtar_common/admin.py
+++ b/ishtar_common/admin.py
@@ -1135,7 +1135,7 @@ class ImportActionAdmin(admin.ModelAdmin):
def get_urls(self):
urls = super(ImportActionAdmin, self).get_urls()
my_urls = [
- re_path(r"^import-from-csv/$", self.import_generic),
+ re_path(r"^import-from-csv/$", self.admin_site.admin_view(self.import_generic)),
]
return my_urls + urls
@@ -1293,7 +1293,7 @@ class ImportGEOJSONActionAdmin(object):
def get_urls(self):
urls = super(ImportGEOJSONActionAdmin, self).get_urls()
my_urls = [
- re_path(r"^import-from-geojson/$", self.import_geojson),
+ re_path(r"^import-from-geojson/$", self.admin_site.admin_view(self.import_geojson)),
]
return my_urls + urls
@@ -1519,7 +1519,7 @@ class ImportJSONActionAdmin(admin.ModelAdmin):
def get_urls(self):
urls = super(ImportJSONActionAdmin, self).get_urls()
my_urls = [
- re_path(r"^import-from-json/$", self.import_json),
+ re_path(r"^import-from-json/$", self.admin_site.admin_view(self.import_json)),
]
return my_urls + urls
@@ -1788,7 +1788,7 @@ class CreateDepartmentActionAdmin(GeneralTypeAdmin):
def get_urls(self):
urls = super(CreateDepartmentActionAdmin, self).get_urls()
my_urls = [
- re_path(r"^create-department/$", self.create_area),
+ re_path(r"^create-department/$", self.admin_site.admin_view(self.create_area)),
]
return my_urls + urls
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 2d00f3455..0d9155aef 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -5547,6 +5547,7 @@ class Document(
def set_main_image(self, __, value):
"""
Post importer action - set the imported image as a main image for associated "value" items
+ For instance: use "finds" to set this image as main for associated finds
"""
for item in getattr(self, value).all():
item.main_image = self