Commit 5988105c by Kálmán Viktor

firewall: fixing remaining pep8 errors

parent 29bbf837
from django.test import TestCase from django.test import TestCase
from admin import HostAdmin from admin import HostAdmin
class MockInstance: class MockInstance:
def __init__(self, groups): def __init__(self, groups):
self.groups = MockGroups(groups) self.groups = MockGroups(groups)
class MockGroup: class MockGroup:
def __init__(self, name): def __init__(self, name):
self.name = name self.name = name
class MockGroups: class MockGroups:
def __init__(self, groups): def __init__(self, groups):
self.groups = groups self.groups = groups
...@@ -16,6 +19,7 @@ class MockGroups: ...@@ -16,6 +19,7 @@ class MockGroups:
def all(self): def all(self):
return self.groups return self.groups
class HostAdminTestCase(TestCase): class HostAdminTestCase(TestCase):
def test_no_groups(self): def test_no_groups(self):
instance = MockInstance([]) instance = MockInstance([])
......
...@@ -54,10 +54,12 @@ def firewall_api(request): ...@@ -54,10 +54,12 @@ def firewall_api(request):
translation.activate(lang) translation.activate(lang)
msg = render_to_string( msg = render_to_string(
'mails/notification-ban-now.txt', 'mails/notification-ban-now.txt',
{'user': user, {
'user': user,
'bl': obj, 'bl': obj,
'instance:': obj.host.instance_set.get(), 'instance:': obj.host.instance_set.get(),
'url': settings.CLOUD_URL}) 'url': settings.CLOUD_URL
})
SendMailTask.delay( SendMailTask.delay(
to=obj.host.owner.email, to=obj.host.owner.email,
subject='[IK Cloud] %s' % subject='[IK Cloud] %s' %
......
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