mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
Don't try to migrate accounts if the SimpleUsers group does not exist (fresh install).
see #204
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user