Commit 34cff057 authored by Leonidas Poulopoulos's avatar Leonidas Poulopoulos
Browse files

This commit closes 1755 , closes 1754

parent 33281310
......@@ -26,12 +26,20 @@ class RouteForm(forms.ModelForm):
def clean_source(self):
data = self.cleaned_data['source']
private_error = False
if data:
address = IPNetwork(data)
return self.cleaned_data["source"]
if address.is_private:
private_error = True
raise forms.ValidationError('Private addresses not allowed')
return self.cleaned_data["source"]
except Exception:
raise forms.ValidationError('Invalid network address format')
error_text = 'Invalid network address format'
if private_error:
error_text = 'Private addresses not allowed'
raise forms.ValidationError(error_text)
def clean_destination(self):
data = self.cleaned_data['destination']
......@@ -7,6 +7,7 @@ from django.views.decorators.csrf import csrf_exempt
from django.core import urlresolvers
from django.core import serializers
from django.contrib.auth.decorators import login_required
from django.contrib.auth import logout
from django.http import HttpResponseRedirect, HttpResponseForbidden, HttpResponse
from django.shortcuts import get_object_or_404, render_to_response
from django.core.context_processors import request
......@@ -263,7 +264,8 @@ def add_port(request):
def user_logout(request):
return HttpResponseRedirect(settings.SHIB_LOGOUT_URL)
return HttpResponseRedirect(reverse('group-routes'))
def load_jscript(request, file):
......@@ -99,12 +99,10 @@
<div id="footer">
{% comment %}
{% if user.is_authenticated %}
{% trans "If you have any questions or need help, contact GRNET Helpdesk at <a href=''></a> or 800-11-47638." %}<br />
{% endif %}
<a href="">{% trans "GRNET" %} NOC</a> | <a href="/about/info/">{% trans "Info" %}</a> | <a href="/about/terms-of-service">{% trans "Service Terms" %}</a>
{% endcomment %}
<a href="">{% trans "GRNET" %} NOC</a> | <a href="#">{% trans "Info" %}</a> | <a href="#">{% trans "Service Terms" %}</a>
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