Commit 1190f1f1 authored by Sergios Aftsidis's avatar Sergios Aftsidis

Temporarily fix error when PeerSite does not exist

parent 7978ecb2
......@@ -42,11 +42,15 @@ def peer_ifces(request, peer_id):
def site_devices(request, site_id):
site = PeerSite.objects.get(pk=site_id)
if site.peer_id.peer_tag == 'GRNET':
ifces = PeerIfces.objects.filter(grnet_device_location=site.peer_site_location)
else:
ifces = PeerIfces.objects.filter(peer_site__site_id=site_id).order_by('name')
try:
site = PeerSite.objects.get(pk=site_id)
except:
site = None
if site:
if site.peer_id.peer_tag == 'GRNET':
ifces = PeerIfces.objects.filter(grnet_device_location=site.peer_site_location)
else:
ifces = PeerIfces.objects.filter(peer_site__site_id=site_id).order_by('name')
response = []
for ifce in ifces:
found = False
......
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 to comment