Don't try to migrate accounts if the SimpleUsers group does not exist (fresh install).

see #204
This commit is contained in:
Antoine Nguyen
2012-04-26 17:29:44 +02:00
parent 3924c2bd3d
commit 4f0cd1215b
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -8,7 +8,10 @@ class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
sugroup = orm["auth.Group"].objects.get(name="SimpleUsers")
try:
sugroup = orm["auth.Group"].objects.get(name="SimpleUsers")
except orm["auth.Group"].DoesNotExist:
return
for account in orm["auth.User"].objects.all():
if not len(account.groups.all()):
account.groups.add(sugroup)
+1 -1
View File
@@ -28,7 +28,7 @@
<div class="row"><span class="title">{% trans "Last modification date" %}</span><span>{{ domain.last_modification }}</<span></div>
<div class="row"><span class="title">{% trans "Domain aliases" %}</span><span>{{ domain.domainalias_count }}</<span></div>
<div class="row"><span class="title">{% trans "Mailboxes" %}</span><span>{{ domain.mailbox_count }}</<span></div>
<div class="row"><span class="title">{% trans "Mailbox aliase" %}</span><span>{{ domain.mbalias_count }}</<span></div>
<div class="row"><span class="title">{% trans "Mailbox aliases" %}</span><span>{{ domain.mbalias_count }}</<span></div>
</div>
</div>
{% endblock %}