Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.2.x #11863

Closed
wants to merge 17 commits into from
Closed

4.2.x #11863

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
f2a2783
Add missing init for facets module (#11638) (#11639)
github-actions[bot] Oct 26, 2023
8f330a4
[Backport 4.2.x] Fixes #11644 and #11652 (#11667)
giohappy Nov 6, 2023
0992701
[Fixes #11447, #11668] Various fixes in GeoFence permissions (#11669)…
github-actions[bot] Nov 9, 2023
7531379
Update default avatar image (#11676) (#11682)
github-actions[bot] Nov 10, 2023
19c4567
fix: scripts/docker/nginx/Dockerfile to reduce vulnerabilities (#1163…
github-actions[bot] Nov 13, 2023
4701397
[Fixes#11651] Implement the option to register users without automati…
github-actions[bot] Nov 15, 2023
bacb8ed
Control read only mode with environmental variable #11710 (#11711) (#…
github-actions[bot] Nov 21, 2023
bdbe37a
[Fixes #11716] extension for remote document is not saved (#11717) (#…
github-actions[bot] Nov 24, 2023
79bbcec
begin
gdmty Jan 19, 2024
0f39172
Merge remote-tracking branch 'origin/4.2.x' into 4.2.x
gdmty Jan 19, 2024
510b42b
update for django 4.2.x
cesarbenjamindotnet Jan 19, 2024
784e6fe
requeriments - update for django 4.2.x
cesarbenjamindotnet Jan 19, 2024
b0164bf
requeriments - update for django 4.2.x
cesarbenjamindotnet Jan 19, 2024
88c108e
requeriments - update for django 4.2.x
cesarbenjamindotnet Jan 19, 2024
76a9378
requeriments - update for django 4.2.x
cesarbenjamindotnet Jan 19, 2024
3bdc8e1
"allauth.account.middleware.AccountMiddleware", # required by allauth
cesarbenjamindotnet Jan 21, 2024
80e858a
fix of naive datetimes on fixtures
cesarbenjamindotnet Jan 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions geonode/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@

from django.apps import apps
from django.db.models import Q
from django.conf.urls import url
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from django.urls import reverse
from django.urls import re_path, reverse
from django.contrib.contenttypes.models import ContentType
from django.conf import settings
from django.db.models import Count
Expand Down Expand Up @@ -550,7 +549,7 @@ def dehydrate(self, bundle):
def prepend_urls(self):
if settings.HAYSTACK_SEARCH:
return [
url(
re_path(
r"^(?P<resource_name>{})/search{}$".format(self._meta.resource_name, trailing_slash()),
self.wrap_view("get_search"),
name="api_get_search",
Expand Down
4 changes: 2 additions & 2 deletions geonode/api/resourcebase_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

from guardian.shortcuts import get_objects_for_user

from django.conf.urls import url
from django.urls import re_path
from django.core.paginator import Paginator, InvalidPage
from django.http import Http404
from django.core.exceptions import ObjectDoesNotExist
Expand Down Expand Up @@ -576,7 +576,7 @@ def create_response(self, request, data, response_class=HttpResponse, response_o
def prepend_urls(self):
if settings.HAYSTACK_SEARCH:
return [
url(
re_path(
r"^(?P<resource_name>{})/search{}$".format(self._meta.resource_name, trailing_slash()),
self.wrap_view("get_search"),
name="api_get_search",
Expand Down
2 changes: 1 addition & 1 deletion geonode/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from functools import wraps

from django.conf import settings
from django.utils.translation import ugettext_noop as _
from django.utils.translation import gettext_noop as _

from geonode.notifications_helper import NotificationsAppConfigBase

Expand Down
2 changes: 1 addition & 1 deletion geonode/base/enumerations.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
#########################################################################

from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

LINK_TYPES = ["original", "data", "image", "metadata", "html", "OGC:WMS", "OGC:WFS", "OGC:WCS"]

Expand Down
16 changes: 8 additions & 8 deletions geonode/base/fixtures/group_test_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"description": "baz",
"logo": "people_peoplegroup/cactuar_1.jpg",
"slug": "bar",
"last_modified": "2011-06-09 15:45:34",
"created": "2011-06-09 15:45:34",
"last_modified": "2011-06-09T15:45:34-06:00",
"created": "2011-06-09T15:45:34-06:00",
"group": 1,
"title": "bar"
},
Expand All @@ -23,14 +23,14 @@
},
{
"fields": {
"date_joined": "2011-06-09 15:15:27",
"date_joined": "2011-06-09T15:15:27-06:00",
"email": "[email protected]",
"first_name": "admin",
"groups": [],
"is_active": true,
"is_staff": true,
"is_superuser": true,
"last_login": "2011-06-09 15:45:34",
"last_login": "2011-06-09T15:45:34-06:00",
"last_name": "",
"password": "pbkdf2_sha256$30000$rjuGt0Obn8on$cxF75frIOSaitNklLZ0IJ/VonUW0fwEFVF96o0M+lGc=",
"user_permissions": [],
Expand All @@ -41,14 +41,14 @@
},
{
"fields": {
"date_joined": "2011-06-09 15:46:03",
"date_joined": "2011-06-09T15:46:03-06:00",
"email": "",
"first_name": "Norman",
"groups": [],
"is_active": true,
"is_staff": false,
"is_superuser": false,
"last_login": "2011-06-09 15:46:03",
"last_login": "2011-06-09T15:46:03-06:00",
"last_name": "Normandy",
"password": "sha1$b0022$1592757da52adeed741051a203fe2d65b6798e83",
"user_permissions": [],
Expand All @@ -59,14 +59,14 @@
},
{
"fields": {
"date_joined": "2011-06-09 15:46:03",
"date_joined": "2011-06-09T15:46:03-06:00",
"email": "",
"first_name": "Test",
"groups": [],
"is_active": true,
"is_staff": false,
"is_superuser": false,
"last_login": "2011-06-09 15:46:03",
"last_login": "2011-06-09T15:46:03-06:00",
"last_name": "User",
"password": "sha1$b0022$1592757da52adeed741051a203fe2d65b6798e83",
"user_permissions": [],
Expand Down
12 changes: 6 additions & 6 deletions geonode/base/fixtures/profiles_test_data.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[
{
"fields": {
"date_joined": "2011-06-09 15:15:27",
"date_joined": "2011-06-09T15:15:27-06:00",
"email": "[email protected]",
"first_name": "admin",
"groups": [],
"is_active": true,
"is_staff": true,
"is_superuser": true,
"last_login": "2011-06-09 15:45:34",
"last_login": "2011-06-09T15:45:34-06:00",
"last_name": "",
"password": "pbkdf2_sha256$30000$rjuGt0Obn8on$cxF75frIOSaitNklLZ0IJ/VonUW0fwEFVF96o0M+lGc=",
"user_permissions": [],
Expand All @@ -19,14 +19,14 @@
},
{
"fields": {
"date_joined": "2011-06-09 15:46:03",
"date_joined": "2011-06-09T15:46:03-06:00",
"email": "",
"first_name": "Norman",
"groups": [],
"is_active": true,
"is_staff": false,
"is_superuser": false,
"last_login": "2011-06-09 15:46:03",
"last_login": "2011-06-09T15:46:03-06:00",
"last_name": "Normandy",
"password": "sha1$b0022$1592757da52adeed741051a203fe2d65b6798e83",
"user_permissions": [],
Expand All @@ -37,14 +37,14 @@
},
{
"fields": {
"date_joined": "2011-06-09 15:46:03",
"date_joined": "2011-06-09T15:46:03-06:00",
"email": "",
"first_name": "Test",
"groups": [],
"is_active": true,
"is_staff": false,
"is_superuser": false,
"last_login": "2011-06-09 15:46:03",
"last_login": "2011-06-09T15:46:03-06:00",
"last_name": "User",
"password": "sha1$b0022$1592757da52adeed741051a203fe2d65b6798e83",
"user_permissions": [],
Expand Down
20 changes: 10 additions & 10 deletions geonode/base/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
from django.forms import models
from django.forms.fields import ChoiceField, MultipleChoiceField
from django.forms.utils import flatatt
from django.utils.encoding import force_text
from django.utils.encoding import force_str
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from modeltranslation.forms import TranslationModelForm
from taggit.forms import TagField
from tinymce.widgets import TinyMCE
Expand Down Expand Up @@ -151,7 +151,7 @@ def value_from_datadict(self, data, files, name):
def render_option_value(self, selected_choices, option_value, option_label, data_section=None):
if option_value is None:
option_value = ""
option_value = force_text(option_value)
option_value = force_str(option_value)
if option_value in selected_choices:
selected_html = mark_safe(" selected")
if not self.allow_multiple_selected:
Expand All @@ -160,12 +160,12 @@ def render_option_value(self, selected_choices, option_value, option_label, data
else:
selected_html = ""

label = force_text(option_label)
label = force_str(option_label)

if data_section is None:
data_section = ""
else:
data_section = force_text(data_section)
data_section = force_str(data_section)
if "/" in data_section:
label = format_html("{} [{}]", label, data_section.rsplit("/", 1)[1])

Expand All @@ -181,7 +181,7 @@ def _region_id_from_choice(choice):
else:
return choice.id

selected_choices = {force_text(_region_id_from_choice(v)) for v in selected_choices}
selected_choices = {force_str(_region_id_from_choice(v)) for v in selected_choices}
output = []

output.append(format_html('<optgroup label="{}">', "Global"))
Expand All @@ -192,25 +192,25 @@ def _region_id_from_choice(choice):

for option_value, option_label in self.choices:
if isinstance(option_label, (list, tuple)) and not isinstance(option_label, str):
output.append(format_html('<optgroup label="{}">', force_text(option_value)))
output.append(format_html('<optgroup label="{}">', force_str(option_value)))
for option in option_label:
if isinstance(option, (list, tuple)) and not isinstance(option, str):
if isinstance(option[1][0], (list, tuple)) and not isinstance(option[1][0], str):
for option_child in option[1][0]:
output.append(
self.render_option_value(
selected_choices, *option_child, data_section=force_text(option[1][0][0])
selected_choices, *option_child, data_section=force_str(option[1][0][0])
)
)
else:
output.append(
self.render_option_value(
selected_choices, *option[1], data_section=force_text(option[0])
selected_choices, *option[1], data_section=force_str(option[0])
)
)
else:
output.append(
self.render_option_value(selected_choices, *option, data_section=force_text(option_value))
self.render_option_value(selected_choices, *option, data_section=force_str(option_value))
)
output.append("</optgroup>")

Expand Down
2 changes: 1 addition & 1 deletion geonode/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from django.contrib.gis.geos import GEOSGeometry, Polygon, Point
from django.contrib.gis.db.models import PolygonField
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.contrib.contenttypes.models import ContentType
from django.utils.html import strip_tags
from mptt.models import MPTTModel, TreeForeignKey
Expand Down
6 changes: 3 additions & 3 deletions geonode/base/templatetags/base_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
from django.db.models import Q
from django.conf import settings
from django.db.models import Count
from django.utils.translation import ugettext
from django.utils.translation import gettext
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.contrib.contenttypes.models import ContentType

from pinax.ratings.models import Rating
Expand Down Expand Up @@ -53,7 +53,7 @@
@register.filter(name="template_trans")
def template_trans(text):
try:
return ugettext(text)
return gettext(text)
except Exception:
return text

Expand Down
2 changes: 1 addition & 1 deletion geonode/base/templatetags/user_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from django.conf import settings
from django.db.models import Sum
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

register = template.Library()

Expand Down
22 changes: 11 additions & 11 deletions geonode/base/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#########################################################################
from django.conf.urls import url, include
from django.urls import include, re_path

from .views import (
DatasetsAutocomplete,
Expand All @@ -32,50 +32,50 @@


urlpatterns = [
url(
re_path(
r"^autocomplete_response/$",
ResourceBaseAutocomplete.as_view(),
name="autocomplete_base",
),
url(
re_path(
r"^autocomplete_linked_resource/$",
LinkedResourcesAutocomplete.as_view(),
name="autocomplete_linked_resource",
),
url(
re_path(
r"^autocomplete_region/$",
RegionAutocomplete.as_view(),
name="autocomplete_region",
),
url(
re_path(
r"^autocomplete_hierachical_keyword/$",
HierarchicalKeywordAutocomplete.as_view(),
name="autocomplete_hierachical_keyword",
),
url(
re_path(
r"^thesaurus_available",
ThesaurusAvailable.as_view(),
name="thesaurus_available",
),
url(
re_path(
r"^thesaurus_autocomplete/$",
ThesaurusKeywordLabelAutocomplete.as_view(),
name="thesaurus_autocomplete",
),
url(
re_path(
r"^datasets_autocomplete/$",
DatasetsAutocomplete.as_view(),
name="datasets_autocomplete",
),
url(
re_path(
r"^resource_rights/(?P<pk>\d+)$",
OwnerRightsRequestView.as_view(),
name="owner_rights_request",
),
url(
re_path(
r"^resource_clone/?$",
resource_clone,
name="resource_clone",
),
url(r"^", include("geonode.base.api.urls")),
re_path(r"^", include("geonode.base.api.urls")),
]
2 changes: 1 addition & 1 deletion geonode/base/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from django.http import HttpResponseRedirect
from django.contrib.auth import get_user_model
from django.contrib import messages
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django.core.exceptions import PermissionDenied
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
Expand Down
4 changes: 2 additions & 2 deletions geonode/catalogue/metadataxsl/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
#########################################################################

from django.conf.urls import url
from django.urls import re_path
from . import views

urlpatterns = [url(r"^xsl/(?P<id>\d+)$", views.prefix_xsl_line, name="prefix_xsl_line")]
urlpatterns = [re_path(r"^xsl/(?P<id>\d+)$", views.prefix_xsl_line, name="prefix_xsl_line")]
2 changes: 1 addition & 1 deletion geonode/catalogue/metadataxsl/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from django.conf import settings
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django.core.exceptions import PermissionDenied
from django.views.decorators.clickjacking import xframe_options_exempt

Expand Down
Loading