Skip to content

Commit

Permalink
[Fixes #12921] Fix Layers admin interface raise error (#12922)
Browse files Browse the repository at this point in the history
* [Fixes #12921] Fix Layers admin interface raise error

* [Fixes #12921] Fix Layers admin interface raise error
  • Loading branch information
mattiagiupponi authored Feb 19, 2025
1 parent 267ad61 commit e15b56c
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 25 deletions.
3 changes: 0 additions & 3 deletions geonode/base/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,6 @@ class Meta:
queryset=ThesaurusKeyword.objects.prefetch_related(
Prefetch("keyword", queryset=ThesaurusKeywordLabel.objects.filter(lang="en"))
),
widget=autocomplete.ModelSelect2Multiple(
url="thesaurus_autocomplete",
),
label=_("Keywords from Thesaurus"),
required=False,
help_text=_(
Expand Down
2 changes: 1 addition & 1 deletion geonode/documents/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Meta(ResourceBaseAdminForm.Meta):


class DocumentAdmin(TabbedTranslationAdmin):
exclude = ("ll_bbox_polygon", "bbox_polygon", "srid")
exclude = ("ll_bbox_polygon", "bbox_polygon", "srid", "tkeywords")
list_display = (
"id",
"title",
Expand Down
2 changes: 1 addition & 1 deletion geonode/geoapps/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Meta(ResourceBaseAdminForm.Meta):


class GeoAppAdmin(TabbedTranslationAdmin):
exclude = ("ll_bbox_polygon", "bbox_polygon", "srid")
exclude = ("ll_bbox_polygon", "bbox_polygon", "srid", "tkeywords")
list_display_links = ("title",)
list_display = (
"id",
Expand Down
20 changes: 1 addition & 19 deletions geonode/layers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,13 @@
#########################################################################

from django.contrib import admin
from django.db.models import Prefetch

from modeltranslation.admin import TabbedTranslationAdmin

from geonode.base.admin import ResourceBaseAdminForm
from geonode.layers.models import Dataset, Attribute, Style
from geonode.base.admin import metadata_batch_edit

from geonode.base.fields import MultiThesauriField
from geonode.base.models import ThesaurusKeyword, ThesaurusKeywordLabel

from dal import autocomplete


class AttributeInline(admin.TabularInline):
model = Attribute
Expand All @@ -41,21 +35,9 @@ class Meta(ResourceBaseAdminForm.Meta):
model = Dataset
fields = "__all__"

tkeywords = MultiThesauriField(
queryset=ThesaurusKeyword.objects.prefetch_related(
Prefetch("keyword", queryset=ThesaurusKeywordLabel.objects.filter(lang="en"))
),
widget=autocomplete.ModelSelect2Multiple(
url="thesaurus_autocomplete",
),
label=("Keywords from Thesaurus"),
required=False,
help_text=("List of keywords from Thesaurus",),
)


class DatasetAdmin(TabbedTranslationAdmin):
exclude = ("ll_bbox_polygon", "bbox_polygon", "srid")
exclude = ("ll_bbox_polygon", "bbox_polygon", "srid", "tkeywords")
list_display = (
"id",
"alternate",
Expand Down
2 changes: 1 addition & 1 deletion geonode/maps/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class MapAdmin(TabbedTranslationAdmin):
inlines = [
MapLayerInline,
]
exclude = ("ll_bbox_polygon", "bbox_polygon", "srid")
exclude = ("ll_bbox_polygon", "bbox_polygon", "srid", "tkeywords")
list_display_links = ("title",)
list_display = (
"id",
Expand Down

0 comments on commit e15b56c

Please # to comment.