mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
@@ -3,6 +3,7 @@ import datetime
|
||||
from south.db import db
|
||||
from south.v2 import DataMigration
|
||||
from django.db import models
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
|
||||
class Migration(DataMigration):
|
||||
|
||||
@@ -10,7 +11,7 @@ class Migration(DataMigration):
|
||||
"Write your forwards methods here."
|
||||
try:
|
||||
ext = orm["admin.Extension"].objects.get(name="amavis_quarantine")
|
||||
except orm["admin.Extension"].DoesNotExist:
|
||||
except ObjectDoesNotExist:
|
||||
return
|
||||
ext.name = "amavis"
|
||||
ext.save()
|
||||
@@ -19,7 +20,7 @@ class Migration(DataMigration):
|
||||
"Write your backwards methods here."
|
||||
try:
|
||||
ext = orm["admin.Extension"].objects.get(name="amavis")
|
||||
except orm["admin.Extension"].DoesNotExist:
|
||||
except ObjectDoesNotExist:
|
||||
return
|
||||
ext.name = "amavis_quarantine"
|
||||
ext.save()
|
||||
|
||||
@@ -3,6 +3,7 @@ import datetime
|
||||
from south.db import db
|
||||
from south.v2 import DataMigration
|
||||
from django.db import models
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
|
||||
class Migration(DataMigration):
|
||||
|
||||
@@ -14,8 +15,11 @@ class Migration(DataMigration):
|
||||
spam_modifies_subj=None)
|
||||
for dom in orm["admin.Domain"].objects.all():
|
||||
orm["amavis.Users"].objects.create(email="@%s" % dom.name, fullname=dom.name,
|
||||
local='1', priority=7, policy_id=1)
|
||||
ext = orm["admin.Extension"].objects.get(name="amavis")
|
||||
priority=7, policy_id=1)
|
||||
try:
|
||||
ext = orm["admin.Extension"].objects.get(name="amavis")
|
||||
except ObjectDoesNotExist:
|
||||
return
|
||||
if ext.enabled:
|
||||
for dom in orm["admin.Domain"].objects.all():
|
||||
u = orm["amavis.Users"].objects.get(email="@%s" % dom.name)
|
||||
|
||||
Reference in New Issue
Block a user