Skip to content
Snippets Groups Projects
Commit 293194bc authored by Benoit Alessandroni's avatar Benoit Alessandroni
Browse files

major: update to django4

parent 19b2d14e
No related branches found
No related tags found
1 merge request!2major: update to django4
Pipeline #15346 passed with stage
in 30 seconds
---
image: python:3.6
stages:
- release
include:
- project: 'infra/platform'
ref: master
file: '/templates/python.ci.yml'
project: infra/gitlab
ref: master
file: /templates/python.ci.yml
publish:
cache: []
extends: .publish_pypi
......@@ -19,6 +19,7 @@ from .models import (
)
@admin.register(ApplicationComponentParameter, ApplicationGraphics, ApplicationNPM, ApplicationPackageParameter, ApplicationService, ComponentExtensionParameter, Federation)
class EmptyAdmin(admin.ModelAdmin):
def get_model_perms(self, request):
return {}
......@@ -68,6 +69,7 @@ class FederationInline(admin.TabularInline):
extra = 0
@admin.register(Application)
class ApplicationAdmin(DjangoLDPAdmin):
list_display = ("urlid", "friendly_name", "short_description")
exclude = (
......@@ -94,6 +96,7 @@ class ApplicationPackageParameterInline(admin.TabularInline):
extra = 0
@admin.register(ApplicationPackage)
class ApplicationPackageAdmin(DjangoLDPAdmin):
list_display = ("urlid", "application", "package")
exclude = ("urlid", "slug", "is_backlink", "allow_create_backlink")
......@@ -114,6 +117,7 @@ class ApplicationComponentParameterInline(admin.TabularInline):
extra = 0
@admin.register(ApplicationComponent)
class ApplicationComponentAdmin(DjangoLDPAdmin):
list_display = ("urlid", "application", "component")
exclude = ("urlid", "slug", "is_backlink", "allow_create_backlink")
......@@ -134,6 +138,7 @@ class ComponentExtensionParameterInline(admin.TabularInline):
extra = 0
@admin.register(ComponentExtension)
class ComponentExtensionAdmin(DjangoLDPAdmin):
list_display = ("urlid", "base_component", "component")
exclude = ("urlid", "slug", "is_backlink", "allow_create_backlink")
......@@ -150,6 +155,7 @@ class ComponentExtensionAdmin(DjangoLDPAdmin):
ordering = ["base_component__application__slug", "component__slug"]
@admin.register(Deployment)
class DeploymentAdmin(DjangoLDPAdmin):
list_display = ("application", "requester", "date", "status", "resolutionDate")
exclude = ("urlid", "slug", "is_backlink", "allow_create_backlink")
......@@ -162,15 +168,3 @@ class DeploymentAdmin(DjangoLDPAdmin):
ordering = ["application__slug", "date", "resolutionDate"]
admin.site.register(Application, ApplicationAdmin)
admin.site.register(ApplicationComponent, ApplicationComponentAdmin)
admin.site.register(ApplicationComponentParameter, EmptyAdmin)
admin.site.register(ApplicationGraphics, EmptyAdmin)
admin.site.register(ApplicationNPM, EmptyAdmin)
admin.site.register(ApplicationPackage, ApplicationPackageAdmin)
admin.site.register(ApplicationPackageParameter, EmptyAdmin)
admin.site.register(ApplicationService, EmptyAdmin)
admin.site.register(ComponentExtension, ComponentExtensionAdmin)
admin.site.register(ComponentExtensionParameter, EmptyAdmin)
admin.site.register(Deployment, DeploymentAdmin)
admin.site.register(Federation, EmptyAdmin)
......@@ -6,7 +6,7 @@ from django.db import models
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from djangoldp.models import Model
from djangoldp_component.models import Component, Package
from rest_framework.exceptions import ValidationError
......
......@@ -2,7 +2,7 @@ from django.conf import settings
from django.core.mail import send_mail
from django.http import JsonResponse
from django.template import loader
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from djangoldp.filters import LocalObjectOnContainerPathBackend
from djangoldp.models import Model
from djangoldp.views import LDPViewSet
......@@ -35,7 +35,7 @@ if hasattr(settings, "ANSIBLE_SERVERS"):
def get_client_ip(request):
x_forwarded_for = request.META.get("HTTP_X_FORWARDED_FOR")
x_forwarded_for = request.headers.get("x-forwarded-for")
if x_forwarded_for:
ip = x_forwarded_for.split(",")[0]
else:
......
......@@ -10,9 +10,9 @@ license = MIT
[options]
packages = find:
install_requires =
djangoldp~=2.1
djangoldp~=3.0
djangoldp_branding
djangoldp_account~=2.3
djangoldp_account~=3.0
djangoldp_component
djangorestframework-yaml~=2.0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment