diff --git a/apps/activity/urls.py b/apps/activity/urls.py index 125ac7af..fc0b4850 100644 --- a/apps/activity/urls.py +++ b/apps/activity/urls.py @@ -6,10 +6,11 @@ from django.urls import path from . import views app_name = 'activity' + urlpatterns = [ - path('', views.ActivityListView.as_view(),name='activity_list'), - path('/', views.ActivityDetailView.as_view(),name='activity_detail'), - path('/entry/', views.ActivityEntryView.as_view(),name='activity_entry'), - path('/update/', views.ActivityUpdateView.as_view(),name='activity_update'), - path('new/', views.ActivityCreateView.as_view(),name='activity_create'), + path('', views.ActivityListView.as_view(), name='activity_list'), + path('/', views.ActivityDetailView.as_view(), name='activity_detail'), + path('/entry/', views.ActivityEntryView.as_view(), name='activity_entry'), + path('/update/', views.ActivityUpdateView.as_view(), name='activity_update'), + path('new/', views.ActivityCreateView.as_view(), name='activity_create'), ] diff --git a/apps/activity/views.py b/apps/activity/views.py index 7ea61d2e..f6c3ad1d 100644 --- a/apps/activity/views.py +++ b/apps/activity/views.py @@ -1,33 +1,31 @@ # Copyright (C) 2018-2020 by BDE ENS Paris-Saclay # SPDX-License-Identifier: GPL-3.0-or-later -from dal import autocomplete -from django.contrib.auth.mixins import LoginRequiredMixin -from django.db.models import Q -from django.urls import reverse -from django.utils.translation import gettext_lazy as _ -from django.views.generic import CreateView, DetailView,\ - ListView, UpdateView, TemplateView +from django.views.generic import CreateView, DetailView, UpdateView, TemplateView from django_tables2.views import SingleTableView -from .models import Activity, ActivityType +from .models import Activity + class ActivityCreateView(CreateView): model = Activity template_name = 'activity_create.html' - + + class ActivityListView(SingleTableView): model = Activity template_name = 'activity_list.html' + class ActivityDetailView(DetailView): model = Activity template_name = 'activty_detail.html' + class ActivityUpdateView(UpdateView): model = Activity template_name = 'activity_update.html' - + + class ActivityEntryView(TemplateView): pass - diff --git a/apps/member/views.py b/apps/member/views.py index 7d3ed748..c1bdf5cc 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -336,7 +336,7 @@ class ClubCreateView(LoginRequiredMixin, CreateView): def form_valid(self, form): return super().form_valid(form) - + class ClubListView(LoginRequiredMixin, SingleTableView): """ diff --git a/note_kfet/urls.py b/note_kfet/urls.py index 5aa25887..a7afab29 100644 --- a/note_kfet/urls.py +++ b/note_kfet/urls.py @@ -23,7 +23,6 @@ urlpatterns = [ path('i18n/', include('django.conf.urls.i18n')), path('admin/doc/', include('django.contrib.admindocs.urls')), path('admin/', admin.site.urls), - path('accounts/', include('member.urls')), path('accounts/login/', CustomLoginView.as_view()), path('accounts/', include('django.contrib.auth.urls')), path('api/', include('api.urls')),