Commit 14348bfb by Bence Dányi

firewall_gui: create new domain

parent 73000026
......@@ -524,8 +524,9 @@ def show_record(request, id=None):
}
return HttpResponse(json.dumps(record), content_type='application/json')
def show_domain(request, id):
domain = get_object_or_404(Domain, id=id)
def show_domain(request, id=None):
try:
domain = Domain.objects.get(id=id)
domain = {
'id': domain.id,
'name': domain.name,
......@@ -538,6 +539,18 @@ def show_domain(request, id):
'ttl': domain.ttl,
'description': domain.description
}
except:
domain = {
'id': None,
'name': None,
'owner': {
'name': None,
},
'created_at': None,
'modified_at': None,
'ttl': None,
'description': ''
}
return HttpResponse(json.dumps(domain), content_type='application/json')
def make_autocomplete(entity, name='name'):
......
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