mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
PEP8 fixes
This commit is contained in:
@@ -37,7 +37,8 @@ def populate_database():
|
||||
"""
|
||||
dom = DomainFactory.create(name="test.com")
|
||||
admin = UserFactory(
|
||||
username="admin@test.com", groups=('DomainAdmins', ), password='{PLAIN}toto'
|
||||
username="admin@test.com", groups=('DomainAdmins', ),
|
||||
password='{PLAIN}toto'
|
||||
)
|
||||
MailboxFactory(address='admin', domain=dom, user=admin)
|
||||
account = UserFactory.create(
|
||||
@@ -59,7 +60,8 @@ def populate_database():
|
||||
|
||||
dom2 = DomainFactory.create(name='test2.com', quota=0)
|
||||
admin = UserFactory.create(
|
||||
username='admin@test2.com', groups=('DomainAdmins',), password='{PLAIN}toto'
|
||||
username='admin@test2.com', groups=('DomainAdmins',),
|
||||
password='{PLAIN}toto'
|
||||
)
|
||||
MailboxFactory.create(address='admin', domain=dom2, user=admin)
|
||||
u = UserFactory.create(
|
||||
|
||||
@@ -447,8 +447,10 @@ class AccountForm(TabForms):
|
||||
|
||||
|
||||
class AccountWizard(WizardForm):
|
||||
|
||||
"""Account creation wizard.
|
||||
"""
|
||||
|
||||
def __init__(self, request):
|
||||
super(AccountWizard, self).__init__(request)
|
||||
self.add_step(
|
||||
|
||||
@@ -328,8 +328,10 @@ class DomainForm(TabForms):
|
||||
|
||||
|
||||
class DomainWizard(WizardForm):
|
||||
|
||||
"""Domain creation wizard.
|
||||
"""
|
||||
|
||||
def __init__(self, request):
|
||||
super(DomainWizard, self).__init__(request)
|
||||
self.add_step(
|
||||
|
||||
@@ -32,12 +32,14 @@ class ExportDataForm(forms.Form):
|
||||
|
||||
|
||||
class ExportDomainsForm(ExportDataForm):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(ExportDomainsForm, self).__init__(*args, **kwargs)
|
||||
self.fields["filename"].initial = "modoboa-domains.csv"
|
||||
|
||||
|
||||
class ExportIdentitiesForm(ExportDataForm):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(ExportIdentitiesForm, self).__init__(*args, **kwargs)
|
||||
self.fields["filename"].initial = "modoboa-identities.csv"
|
||||
|
||||
@@ -15,6 +15,7 @@ from modoboa.lib.exceptions import (
|
||||
|
||||
|
||||
class Alias(AdminObject):
|
||||
|
||||
"""
|
||||
Mailbox alias.
|
||||
"""
|
||||
|
||||
@@ -6,6 +6,7 @@ from modoboa.lib.permissions import (
|
||||
|
||||
|
||||
class ObjectDates(models.Model):
|
||||
|
||||
"""Dates recording for admin objects
|
||||
|
||||
This table keeps creation and last modification dates for Domains,
|
||||
@@ -32,6 +33,7 @@ class ObjectDates(models.Model):
|
||||
|
||||
|
||||
class AdminObject(models.Model):
|
||||
|
||||
"""Abstract model to support dates
|
||||
|
||||
Inherit from this model to automatically add the "dates" feature
|
||||
|
||||
@@ -27,6 +27,7 @@ class DomainManager(Manager):
|
||||
|
||||
|
||||
class Domain(AdminObject):
|
||||
|
||||
"""Mail domain.
|
||||
"""
|
||||
name = models.CharField(ugettext_lazy('name'), max_length=100, unique=True,
|
||||
|
||||
@@ -136,7 +136,7 @@ def importdata(request, formclass=ImportDataForm):
|
||||
return render(request, "admin/import_done.html", {
|
||||
"status": "ok", "msg": msg
|
||||
})
|
||||
except (ModoboaException), e:
|
||||
except (ModoboaException) as e:
|
||||
error = str(e)
|
||||
|
||||
return render(request, "admin/import_done.html", {
|
||||
|
||||
Reference in New Issue
Block a user