deleted undo state view
This commit is contained in:
parent
4c93a27109
commit
0ed78d997c
|
@ -6,7 +6,6 @@ app_name = 'action'
|
|||
urlpatterns = [
|
||||
|
||||
path("new/", views.ChangeStateView.as_view(), name="change_state"),
|
||||
path('state/<int:pk>/undo/', views.UndoStateView.as_view(), name='undo_state'),
|
||||
path('note/add/', views.AddNoteView.as_view(), name='add_note'),
|
||||
|
||||
path('note/edit/<int:pk>', views.UpdateNoteView.as_view(), name='update_note'),
|
||||
]
|
||||
|
|
|
@ -41,18 +41,6 @@ class ChangeStateView(View):
|
|||
return redirect(request.META.get('HTTP_REFERER') )
|
||||
|
||||
|
||||
class UndoStateView(DeleteView):
|
||||
model = State
|
||||
|
||||
def delete(self, request, *args, **kwargs):
|
||||
self.object = self.get_object()
|
||||
return super().delete(request, *args, **kwarg)
|
||||
|
||||
def get_success_url(self):
|
||||
messages.info(self.request, f"Action to state: {self.object.state} has been deleted.")
|
||||
return self.request.META.get('HTTP_REFERER', reverse_lazy('device:details', args=[self.object.snapshot_uuid]))
|
||||
|
||||
|
||||
class AddNoteView(View):
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
|
|
Loading…
Reference in a new issue