Commit 4cb7aadc authored by chirac's avatar chirac
Browse files

Crée la liste des domaines de l'ARES

parent b0431eb5
......@@ -3,7 +3,7 @@ from django.contrib.auth.models import Group
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from reversion.admin import VersionAdmin
from .models import User, Right, ListRight, ListShell, Request, MailAlias, LdapUser, LdapUserGroup
from .models import User, Right, ListRight, ListShell, ListDomain, Request, MailAlias, LdapUser, LdapUserGroup
from .forms import UserChangeForm, UserCreationForm
......@@ -38,6 +38,9 @@ class MailAliasAdmin(VersionAdmin):
class ListShellAdmin(VersionAdmin):
list_display = ('shell',)
class ListDomainAdmin(VersionAdmin):
list_display = ('domain',)
class RightAdmin(admin.ModelAdmin):
list_display = ('user', 'right')
......@@ -78,6 +81,7 @@, LdapUserGroupAdmin), RightAdmin), ListRightAdmin), ListShellAdmin), ListDomainAdmin), MailAliasAdmin), RequestAdmin)
# Now register the new UserAdmin...
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0010_auto_20160827_1628'),
operations = [
('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)),
('domain', models.CharField(max_length=255, unique=True)),
......@@ -275,6 +275,12 @@ class ListShell(models.Model):
def __str__(self):
class ListDomain(models.Model):
domain = models.CharField(max_length=255, unique=True)
def __str__(self):
return self.domain
class MailAlias(models.Model):
user = models.ForeignKey('User', on_delete=models.PROTECT)
alias = models.CharField(max_length=32, unique=True, help_text="N'indiquer que le préfixe de l'alias (devant", validators=[mail_check])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment