コード例 #1
0
ファイル: views.py プロジェクト: jhazelwo/ksdj
 def delete(self, request, *args, **kwargs):
     self.old = self.get_object()
     try:
         kickstart.client_delete(self.old)
         log_form_valid(self)
         messages.success(self.request, 'Client {0} removed!'.format(self.old.name))
         return super(Delete, self).delete(request, *args, **kwargs)
     except Exception as msg:
         featherfail(self, msg)
     return super(Delete, self).get(request, *args, **kwargs)
コード例 #2
0
 def delete(self, request, *args, **kwargs):
     self.old = self.get_object()
     try:
         kickstart.client_delete(self.old)
         log_form_valid(self)
         messages.success(self.request,
                          'Client {0} removed!'.format(self.old.name))
         return super(Delete, self).delete(request, *args, **kwargs)
     except Exception as msg:
         featherfail(self, msg)
     return super(Delete, self).get(request, *args, **kwargs)
コード例 #3
0
 def form_valid(self, form):
     try:
         old = Client.objects.get(id=self.object.id)
         kickstart.client_delete(old)
         form = kickstart.client_create(form, old)
         log_form_valid(self)
         messages.success(self.request, 'Changes saved!')
         return super(Update, self).form_valid(form)
     except Exception as msg:
         featherfail(self, msg)
     return super(Update, self).form_invalid(form)
コード例 #4
0
ファイル: views.py プロジェクト: jhazelwo/ksdj
 def form_valid(self, form):
     try:
         old = Client.objects.get(id=self.object.id)
         kickstart.client_delete(old)
         form = kickstart.client_create(form, old)
         log_form_valid(self)
         messages.success(self.request, 'Changes saved!')
         return super(Update, self).form_valid(form)
     except Exception as msg:
         featherfail(self, msg)
     return super(Update, self).form_invalid(form)