Commit db39f53e authored by Stauros Kroustouris's avatar Stauros Kroustouris

fix some bugs in flowspec models and views

parent 918241b8
......@@ -313,7 +313,7 @@ class Route(models.Model):
'url': admin_url
}
)
user_mail = '%' % self.applier.email
user_mail = '%s' % self.applier.email
user_mail = user_mail.split(';')
send_new_mail(
settings.EMAIL_SUBJECT_PREFIX + 'Rule %s removal request submitted by %s' % (self.name, self.applier.username),
......
......@@ -5,6 +5,7 @@ import socket
register = template.Library()
@register.filter
def tofqdn(value):
try:
......@@ -13,6 +14,5 @@ def tofqdn(value):
return False
else:
return fqdn
except socket.gaierror:
except:
return False
\ No newline at end of file
......@@ -291,7 +291,7 @@ def edit_route(request, route_slug):
route.response = "Applying"
route.source = IPNetwork('%s/%s' % (IPNetwork(route.source).network.compressed, IPNetwork(route.source).prefixlen)).compressed
route.destination = IPNetwork('%s/%s' % (IPNetwork(route.destination).network.compressed, IPNetwork(route.destination).prefixlen)).compressed
route.requesters_address = self.request.META['HTTP_X_FORWARDED_FOR']
route.requesters_address = request.META['HTTP_X_FORWARDED_FOR']
route.save()
route.commit_edit()
if bool(set(changed_data) & set(critical_changed_values)) or (not route_original.status == 'ACTIVE'):
......
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