404 on crawl not found

This commit is contained in:
Sebastian Lohff 2015-03-28 22:12:42 +01:00
parent 7eda175d24
commit 51b2ee7e45
1 changed files with 6 additions and 1 deletions

View File

@ -6,7 +6,12 @@ def overview(request):
return render(request, 'bgpdata/overview.html', {"crawls": crawls}) return render(request, 'bgpdata/overview.html', {"crawls": crawls})
def showMap(request, crawlId): def showMap(request, crawlId):
crawl = None
try:
crawl = CrawlRun.objects.get(id=crawlId) crawl = CrawlRun.objects.get(id=crawlId)
except CrawlRun.DoesNotExist:
return render(request, "bgpdata/no-map-found.html", {"crawl_id": crawlId})
ASses = AS.objects.filter(crawl=crawl) ASses = AS.objects.filter(crawl=crawl)
peerings = Peering.objects.filter(as1__crawl=crawl) peerings = Peering.objects.filter(as1__crawl=crawl)