mirror of
https://gitlab.crans.org/bde/nk20
synced 2024-11-27 02:43:01 +00:00
Update pre-registrations
This commit is contained in:
parent
bdb0f677e5
commit
6242e316ae
@ -37,7 +37,7 @@ class WEIRegistrationTable(tables.Table):
|
|||||||
)
|
)
|
||||||
|
|
||||||
edit = tables.LinkColumn(
|
edit = tables.LinkColumn(
|
||||||
'wei:wei_detail',
|
'wei:wei_update_registration',
|
||||||
args=[A('pk')],
|
args=[A('pk')],
|
||||||
verbose_name=_("Edit"),
|
verbose_name=_("Edit"),
|
||||||
text=_("Edit"),
|
text=_("Edit"),
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
|
|
||||||
from .views import WEIListView, WEICreateView, WEIDetailView, WEIUpdateView, WEIRegisterView
|
from .views import WEIListView, WEICreateView, WEIDetailView, WEIUpdateView, WEIRegisterView, WEIUpdateRegistrationView
|
||||||
|
|
||||||
|
|
||||||
app_name = 'wei'
|
app_name = 'wei'
|
||||||
@ -13,4 +13,5 @@ urlpatterns = [
|
|||||||
path('detail/<int:pk>/', WEIDetailView.as_view(), name="wei_detail"),
|
path('detail/<int:pk>/', WEIDetailView.as_view(), name="wei_detail"),
|
||||||
path('update/<int:pk>/', WEIUpdateView.as_view(), name="wei_update"),
|
path('update/<int:pk>/', WEIUpdateView.as_view(), name="wei_update"),
|
||||||
path('register/<int:wei_pk>/', WEIRegisterView.as_view(), name="wei_register"),
|
path('register/<int:wei_pk>/', WEIRegisterView.as_view(), name="wei_register"),
|
||||||
|
path('edit_registration/<int:pk>/', WEIUpdateRegistrationView.as_view(), name="wei_update_registration"),
|
||||||
]
|
]
|
||||||
|
@ -136,3 +136,21 @@ class WEIRegisterView(ProtectQuerysetMixin, LoginRequiredMixin, CreateView):
|
|||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
self.object.refresh_from_db()
|
self.object.refresh_from_db()
|
||||||
return reverse_lazy("wei:wei_detail", kwargs={"pk": self.object.wei.pk})
|
return reverse_lazy("wei:wei_detail", kwargs={"pk": self.object.wei.pk})
|
||||||
|
|
||||||
|
|
||||||
|
class WEIUpdateRegistrationView(ProtectQuerysetMixin, LoginRequiredMixin, UpdateView):
|
||||||
|
"""
|
||||||
|
Update a registration for the WEI
|
||||||
|
"""
|
||||||
|
model = WEIRegistration
|
||||||
|
form_class = WEIRegistrationForm
|
||||||
|
|
||||||
|
def get_form(self, form_class=None):
|
||||||
|
form = super().get_form(form_class)
|
||||||
|
del form.fields["user"]
|
||||||
|
return form
|
||||||
|
|
||||||
|
def get_success_url(self):
|
||||||
|
self.object.refresh_from_db()
|
||||||
|
return reverse_lazy("wei:wei_detail", kwargs={"pk": self.object.wei.pk})
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@
|
|||||||
<hr>
|
<hr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if all_registrations.data or True %}
|
{% if all_registrations.data %}
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header position-relative" id="historyListHeading">
|
<div class="card-header position-relative" id="historyListHeading">
|
||||||
<a class="btn btn-link stretched-link font-weight-bold">
|
<a class="btn btn-link stretched-link font-weight-bold">
|
||||||
|
Loading…
Reference in New Issue
Block a user