diff --git a/geonode/base/forms.py b/geonode/base/forms.py index 9ecd0bebedc..d2bc3b4b12b 100644 --- a/geonode/base/forms.py +++ b/geonode/base/forms.py @@ -51,7 +51,7 @@ from geonode.base.fields import MultiThesauriField from geonode.documents.models import Document from geonode.layers.models import Dataset -from geonode.base.utils import validate_extra_metadata, remove_country_from_lanugecode +from geonode.base.utils import validate_extra_metadata, remove_country_from_languagecode logger = logging.getLogger(__name__) @@ -351,7 +351,7 @@ def _get_thesauro_keyword_label(item, lang): # try find results found for given language e.g. (en-us) if no results found remove country code from language to (en) and try again qs_keyword_ids = ThesaurusKeywordLabel.objects.filter(lang=lang, keyword_id__in=keyword_id_for_given_thesaurus).values("keyword_id") if len(qs_keyword_ids) == 0: - lang = remove_country_from_lanugecode(lang) + lang = remove_country_from_languagecode(lang) qs_keyword_ids = ThesaurusKeywordLabel.objects.filter(lang=lang, keyword_id__in=keyword_id_for_given_thesaurus).values("keyword_id") not_qs_ids = ThesaurusKeywordLabel.objects.exclude(keyword_id__in=qs_keyword_ids).order_by("keyword_id").distinct("keyword_id").values("keyword_id") diff --git a/geonode/base/utils.py b/geonode/base/utils.py index 9abac5bbe72..f899a731c7f 100644 --- a/geonode/base/utils.py +++ b/geonode/base/utils.py @@ -191,8 +191,7 @@ def validate_extra_metadata(data, instance): return data -@staticmethod -def remove_country_from_lanugecode(language: str): +def remove_country_from_languagecode(language: str): """ Remove country code (us) from language name (en-us) >>> remove_country_from_lanugecode("en-us") 'en' diff --git a/geonode/base/views.py b/geonode/base/views.py index 7f49a08c20f..ae59dfe49af 100644 --- a/geonode/base/views.py +++ b/geonode/base/views.py @@ -48,7 +48,7 @@ from geonode.resource.manager import resource_manager from geonode.security.utils import get_visible_resources from geonode.notifications_helper import send_notification -from geonode.base.utils import OwnerRightsRequestViewUtils, remove_country_from_lanugecode +from geonode.base.utils import OwnerRightsRequestViewUtils, remove_country_from_languagecode from geonode.base.forms import UserAndGroupPermissionsForm from geonode.base.forms import ( @@ -310,7 +310,7 @@ def get_queryset(self): # try find results found for given language e.g. (en-us) if no results found remove country code from language to (en) and try again qs_keyword_ids = ThesaurusKeywordLabel.objects.filter(lang=lang, keyword_id__in=keyword_id_for_given_thesaurus).values("keyword_id") if len(qs_keyword_ids) == 0: - lang = remove_country_from_lanugecode(lang) + lang = remove_country_from_languagecode(lang) qs_keyword_ids = ThesaurusKeywordLabel.objects.filter(lang=lang, keyword_id__in=keyword_id_for_given_thesaurus).values("keyword_id") not_qs_ids = ThesaurusKeywordLabel.objects.exclude(keyword_id__in=qs_keyword_ids).order_by("keyword_id").distinct("keyword_id").values("keyword_id") diff --git a/requirements.txt b/requirements.txt index db2fa9f79b6..9bfe6690228 100644 --- a/requirements.txt +++ b/requirements.txt @@ -23,7 +23,7 @@ wrapt==1.14.1 jsonschema==4.14.0 zipstream-new==1.1.8 schema==0.7.5 -rdflib==6.2.0 +rdflib==6.1.1 smart_open==6.1.0 # Django Apps diff --git a/setup.cfg b/setup.cfg index 0d616aaefb7..de6a8bf75aa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -49,7 +49,7 @@ install_requires = jsonschema==4.14.0 zipstream-new==1.1.8 schema==0.7.5 - rdflib==6.2.0 + rdflib==6.1.1 smart_open==6.1.0 # Django Apps