Skip to content

Commit

Permalink
update deps, fix urls, fix RoleAssignmentDeleteView (#880)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Jan 5, 2024
1 parent 5247911 commit b198123
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 66 deletions.
103 changes: 48 additions & 55 deletions config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 7 additions & 8 deletions example_project_app/urls.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -10,14 +9,14 @@
# NOTE: If referring to a model from another app, notation is "app__model"

urls = [
url(
regex=r'^(?P<project>[0-9a-f-]+)$',
re_path(
r'^(?P<project>[0-9a-f-]+)$',
view=views.ExampleView.as_view(),
name='example',
),
# Example view with model from an external app
url(
regex=r'^ext/(?P<filesfolders__folder>[0-9a-f-]+)$',
re_path(
r'^ext/(?P<filesfolders__folder>[0-9a-f-]+)$',
view=views.ExampleView.as_view(),
name='example_ext_model',
),
Expand All @@ -36,8 +35,8 @@
]

urls_api = [
url(
regex=r'^api/hello/(?P<project>[0-9a-f-]+)$',
re_path(
r'^api/hello/(?P<project>[0-9a-f-]+)$',
view=views_api.HelloExampleProjectAPIView.as_view(),
name='example_api_hello',
)
Expand Down
1 change: 0 additions & 1 deletion projectroles/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1850,7 +1850,6 @@ class RoleAssignmentDeleteView(
RolePermissionMixin,
ProjectModifyPermissionMixin,
ProjectContextMixin,
CurrentUserFormMixin,
RoleAssignmentDeleteMixin,
DeleteView,
):
Expand Down
8 changes: 6 additions & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b198123

Please sign in to comment.