Skip to content

Commit

Permalink
Resolves GeoNode#6925: add missing prefix for thesaurus
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiagiupponi committed Feb 15, 2021
1 parent d8edeb6 commit 3502569
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions geonode/layers/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,13 +1023,8 @@ def layer_metadata(
if hasattr(settings, 'THESAURUS'):
tkeywords_form = TKeywordForm(request.POST)
else:
tkeywords_form = ThesaurusAvailableForm(request.POST)
tkeywords_form = ThesaurusAvailableForm(request.POST, prefix='tkeywords')
# set initial values for thesaurus form
for tid in tkeywords_form.fields:
values = []
values = [keyword.id for keyword in topic_thesaurus if int(tid) == keyword.thesaurus.id]
tkeywords_form.fields[tid].initial = values

if not tkeywords_form.is_valid():
logger.error(f"Layer Thesauri Keywords form is not valid: {tkeywords_form.errors}")
out = {
Expand Down

0 comments on commit 3502569

Please sign in to comment.