Commit c50fc3e0 by Kálmán Viktor

network: fix host update

parent a017e6cf
......@@ -50,6 +50,7 @@ class HostForm(ModelForm):
'description',
'location',
'comment',
'owner',
# 'created_at',
# 'modified_at',
# 'id'
......
from django.views.generic import TemplateView
from django.views.generic import UpdateView
from django.core.urlresolvers import reverse_lazy
from django_tables2 import SingleTableView
......@@ -23,6 +24,10 @@ class HostDetail(UpdateView):
template_name = "network/host-edit.html"
form_class = HostForm
def get_success_url(self):
if 'pk' in self.kwargs:
return reverse_lazy('network.host', kwargs=self.kwargs)
class VlanList(SingleTableView):
model = Vlan
......@@ -40,3 +45,5 @@ class VlanDetail(UpdateView):
q = Host.objects.filter(vlan=self.object).all()
context['host_list'] = SmallHostTable(q)
return context
success_url = reverse_lazy('network.vlan_list')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment