From b19812364abd146c70a1f1c1ca00f1cd3fc35993 Mon Sep 17 00:00:00 2001 From: Mikko Nieminen Date: Fri, 5 Jan 2024 16:06:41 +0100 Subject: [PATCH] update deps, fix urls, fix RoleAssignmentDeleteView (#880) --- config/urls.py | 103 +++++++++++++++++------------------- example_project_app/urls.py | 15 +++--- projectroles/views.py | 1 - requirements/base.txt | 8 ++- 4 files changed, 61 insertions(+), 66 deletions(-) diff --git a/config/urls.py b/config/urls.py index dc07fb4d..6de17e35 100644 --- a/config/urls.py +++ b/config/urls.py @@ -14,71 +14,64 @@ from projectroles.views import HomeView -urlpatterns = ( - [ - path(route='', view=HomeView.as_view(), name='home'), - # Django Admin, use {% url 'admin:index' %} - path(settings.ADMIN_URL, admin.site.urls), - # Login and logout - path( - route='login/', - view=auth_views.LoginView.as_view(template_name='users/login.html'), - name='login', - ), - path(route='logout/', view=auth_views.logout_then_login, name='logout'), - # Auth - path('api/auth/', include('knox.urls')), - # Iconify SVG icons - path('icons/', include('dj_iconify.urls')), - # Projectroles URLs - path('project/', include('projectroles.urls')), - # Admin Alerts URLs - path('alerts/adm/', include('adminalerts.urls')), - # App Alerts URLs - path('alerts/app/', include('appalerts.urls')), - # Background Jobs URLs - path('bgjobs/', include('bgjobs.urls')), - # Filesfolders URLs - path('files/', include('filesfolders.urls')), - # django-db-file-storage URLs (obfuscated for users) - path( - 'DJANGO-DB-FILE-STORAGE-CHANGE-ME/', include('db_file_storage.urls') - ), - # Site Info URLs - path('siteinfo/', include('siteinfo.urls')), - # SODAR Cache app - path('cache/', include('sodarcache.urls')), - # Timeline URLs - path('timeline/', include('timeline.urls')), - # API Tokens URLs - path('tokens/', include('tokens.urls')), - # User Profile URLs - path('user/', include('userprofile.urls')), - # Example project app URLs - path('examples/project/', include('example_project_app.urls')), - # Example site app URLs - path('examples/site/', include('example_site_app.urls')), - # SAML support temporarily disabled (see #597, #880) - ''' +urlpatterns = [ + path(route='', view=HomeView.as_view(), name='home'), + # Django Admin, use {% url 'admin:index' %} + path(settings.ADMIN_URL, admin.site.urls), + # Login and logout + path( + route='login/', + view=auth_views.LoginView.as_view(template_name='users/login.html'), + name='login', + ), + path(route='logout/', view=auth_views.logout_then_login, name='logout'), + # Auth + path('api/auth/', include('knox.urls')), + # Iconify SVG icons + path('icons/', include('dj_iconify.urls')), + # Projectroles URLs + path('project/', include('projectroles.urls')), + # Admin Alerts URLs + path('alerts/adm/', include('adminalerts.urls')), + # App Alerts URLs + path('alerts/app/', include('appalerts.urls')), + # Background Jobs URLs + path('bgjobs/', include('bgjobs.urls')), + # Filesfolders URLs + path('files/', include('filesfolders.urls')), + # django-db-file-storage URLs (obfuscated for users) + path('DJANGO-DB-FILE-STORAGE-CHANGE-ME/', include('db_file_storage.urls')), + # Site Info URLs + path('siteinfo/', include('siteinfo.urls')), + # SODAR Cache app + path('cache/', include('sodarcache.urls')), + # Timeline URLs + path('timeline/', include('timeline.urls')), + # API Tokens URLs + path('tokens/', include('tokens.urls')), + # User Profile URLs + path('user/', include('userprofile.urls')), + # Example project app URLs + path('examples/project/', include('example_project_app.urls')), + # Example site app URLs + path('examples/site/', include('example_site_app.urls')), + # SAML support temporarily disabled (see #597, #880) # These are the SAML2 related URLs. You can change "^saml2_auth/" regex to # any path you want, like "^sso_auth/", "^sso_login/", etc. (required) - path('saml2_auth/', include('django_saml2_auth.urls')), + # path('saml2_auth/', include('django_saml2_auth.urls')), # The following line will replace the default user login with SAML2 (optional) # If you want to specific the after-login-redirect-URL, use parameter "?next=/the/path/you/want" # with this view. - path('sso/login/', django_saml2_auth.views.signin), + # path('sso/login/', django_saml2_auth.views.signin), # The following line will replace the admin login with SAML2 (optional) # If you want to specific the after-login-redirect-URL, use parameter "?next=/the/path/you/want" # with this view. - path('sso/admin/login/', django_saml2_auth.views.signin), + # path('sso/admin/login/', django_saml2_auth.views.signin), # The following line will replace the default user logout with the signout page (optional) - path('sso/logout/', django_saml2_auth.views.signout), + # path('sso/logout/', django_saml2_auth.views.signout), # The following line will replace the default admin user logout with the signout page (optional) - path('sso/admin/logout/', django_saml2_auth.views.signout), - ''', - ] - + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) -) + # path('sso/admin/logout/', django_saml2_auth.views.signout), +] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) if settings.DEBUG: diff --git a/example_project_app/urls.py b/example_project_app/urls.py index 3f3e6d8c..e6778d01 100644 --- a/example_project_app/urls.py +++ b/example_project_app/urls.py @@ -1,5 +1,4 @@ -from django.conf.urls import url -from django.urls import path +from django.urls import path, re_path from example_project_app import views, views_api @@ -10,14 +9,14 @@ # NOTE: If referring to a model from another app, notation is "app__model" urls = [ - url( - regex=r'^(?P[0-9a-f-]+)$', + re_path( + r'^(?P[0-9a-f-]+)$', view=views.ExampleView.as_view(), name='example', ), # Example view with model from an external app - url( - regex=r'^ext/(?P[0-9a-f-]+)$', + re_path( + r'^ext/(?P[0-9a-f-]+)$', view=views.ExampleView.as_view(), name='example_ext_model', ), @@ -36,8 +35,8 @@ ] urls_api = [ - url( - regex=r'^api/hello/(?P[0-9a-f-]+)$', + re_path( + r'^api/hello/(?P[0-9a-f-]+)$', view=views_api.HelloExampleProjectAPIView.as_view(), name='example_api_hello', ) diff --git a/projectroles/views.py b/projectroles/views.py index 46303124..9c89a848 100644 --- a/projectroles/views.py +++ b/projectroles/views.py @@ -1850,7 +1850,6 @@ class RoleAssignmentDeleteView( RolePermissionMixin, ProjectModifyPermissionMixin, ProjectContextMixin, - CurrentUserFormMixin, RoleAssignmentDeleteMixin, DeleteView, ): diff --git a/requirements/base.txt b/requirements/base.txt index 398a03bd..706351fd 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -59,7 +59,9 @@ rules>=3.3, <3.4 djangorestframework>=3.14.0, <3.15 # Keyed list addon for DRF -drf-keyed-list-bihealth==0.1.1 +# drf-keyed-list-bihealth==0.1.1 +-e git+https://github.com/bihealth/drf-keyed-list.git@9c756c28520c6ee6733a031e96bc55a27416407b#egg=drf-keyed-list-bihealth + # Token authentication django-rest-knox>=4.2.0, <4.3 @@ -71,7 +73,9 @@ django-pagedown>=2.2.1, <2.3 mistune>=2.0.5, <2.1 # Database file storage for filesfolders -django-db-file-storage==0.5.5 +# django-db-file-storage==0.5.5 +# NOTE: Fork used for now +-e git+https://github.com/Aagam41/django_db_file_storage.git@3b273d7fae5b8b8e8919dda2fff307c80834115e#egg=django-db-file-storage # Celery dependency redis>=4.4.4