Commit 937f2cf1 authored by klafyvel's avatar klafyvel Committed by Gabriel Detraz
Browse files

Fix miscellanous model creation mistakes.

parent 392ea8af
...@@ -445,7 +445,7 @@ class Migration(migrations.Migration): ...@@ -445,7 +445,7 @@ class Migration(migrations.Migration):
verbose_name="ID", verbose_name="ID",
), ),
), ),
("date", models.DateTimeField(auto_now_add=True, verbose_name="Date")), ("date", models.DateTimeField(auto_now_add=True, verbose_name="date")),
], ],
bases=( bases=(
re2o.mixins.RevMixin, re2o.mixins.RevMixin,
...@@ -506,14 +506,14 @@ class Migration(migrations.Migration): ...@@ -506,14 +506,14 @@ class Migration(migrations.Migration):
), ),
( (
"recipient", "recipient",
models.CharField(max_length=255, verbose_name="Recipient"), models.CharField(max_length=255, verbose_name="recipient"),
), ),
( (
"payment", "payment",
models.CharField(max_length=255, verbose_name="Payment type"), models.CharField(max_length=255, verbose_name="payment type"),
), ),
("address", models.CharField(max_length=255, verbose_name="Address")), ("address", models.CharField(max_length=255, verbose_name="address")),
("paid", models.BooleanField(verbose_name="Paid")), ("paid", models.BooleanField(default=False, verbose_name="paid")),
( (
"remark", "remark",
models.TextField(verbose_name="remark", blank=True, null=True), models.TextField(verbose_name="remark", blank=True, null=True),
...@@ -521,7 +521,9 @@ class Migration(migrations.Migration): ...@@ -521,7 +521,9 @@ class Migration(migrations.Migration):
], ],
bases=("cotisations.baseinvoice",), bases=("cotisations.baseinvoice",),
options={ options={
"permissions": (("view_custominvoice", "Can view a custom invoice"),) "permissions": (
("view_custominvoice", "Can view a custom invoice object"),
)
}, },
), ),
migrations.CreateModel( migrations.CreateModel(
...@@ -541,7 +543,7 @@ class Migration(migrations.Migration): ...@@ -541,7 +543,7 @@ class Migration(migrations.Migration):
( (
"validity", "validity",
models.DurationField( models.DurationField(
verbose_name="Period of validity", help_text="DD HH:MM:SS" verbose_name="period of validity", help_text="DD HH:MM:SS"
), ),
), ),
], ],
...@@ -588,7 +590,6 @@ class Migration(migrations.Migration): ...@@ -588,7 +590,6 @@ class Migration(migrations.Migration):
"duration_days_connection", "duration_days_connection",
models.PositiveIntegerField( models.PositiveIntegerField(
default=0, default=0,
validators=[django.core.validators.MinValueValidator(0)],
verbose_name="duration of the connection (in days, will be added to duration in months)", verbose_name="duration of the connection (in days, will be added to duration in months)",
), ),
), ),
...@@ -602,7 +603,6 @@ class Migration(migrations.Migration): ...@@ -602,7 +603,6 @@ class Migration(migrations.Migration):
"duration_days_membership", "duration_days_membership",
models.PositiveIntegerField( models.PositiveIntegerField(
default=0, default=0,
validators=[django.core.validators.MinValueValidator(0)],
verbose_name="duration of the membership (in days, will be added to duration in months)", verbose_name="duration of the membership (in days, will be added to duration in months)",
), ),
), ),
...@@ -651,28 +651,24 @@ class Migration(migrations.Migration): ...@@ -651,28 +651,24 @@ class Migration(migrations.Migration):
( (
"duration_connection", "duration_connection",
models.PositiveIntegerField( models.PositiveIntegerField(
default=0, verbose_name="duration of the connection (in months)" verbose_name="duration of the connection (in months)"
), ),
), ),
( (
"duration_days_connection", "duration_days_connection",
models.PositiveIntegerField( models.PositiveIntegerField(
default=0,
validators=[django.core.validators.MinValueValidator(0)],
verbose_name="duration of the connection (in days, will be added to duration in months)", verbose_name="duration of the connection (in days, will be added to duration in months)",
), ),
), ),
( (
"duration_membership", "duration_membership",
models.PositiveIntegerField( models.PositiveIntegerField(
default=0, verbose_name="duration of the membership (in months)" verbose_name="duration of the membership (in months)"
), ),
), ),
( (
"duration_days_membership", "duration_days_membership",
models.PositiveIntegerField( models.PositiveIntegerField(
default=0,
validators=[django.core.validators.MinValueValidator(0)],
verbose_name="duration of the membership (in days, will be added to duration in months)", verbose_name="duration of the membership (in days, will be added to duration in months)",
), ),
), ),
...@@ -866,7 +862,7 @@ class Migration(migrations.Migration): ...@@ -866,7 +862,7 @@ class Migration(migrations.Migration):
), ),
), ),
], ],
options={"verbose_name", "user balance"}, options={"verbose_name": "user balance"},
), ),
migrations.CreateModel( migrations.CreateModel(
name="ChequePayment", name="ChequePayment",
...@@ -882,7 +878,7 @@ class Migration(migrations.Migration): ...@@ -882,7 +878,7 @@ class Migration(migrations.Migration):
), ),
), ),
], ],
options={"verbose_name", "cheque"}, options={"verbose_name": "cheque"},
), ),
migrations.CreateModel( migrations.CreateModel(
name="ComnpayPayment", name="ComnpayPayment",
...@@ -933,7 +929,7 @@ class Migration(migrations.Migration): ...@@ -933,7 +929,7 @@ class Migration(migrations.Migration):
), ),
), ),
], ],
options={"verbose_name", "ComNpay"}, options={"verbose_name": "ComNpay"},
), ),
migrations.CreateModel( migrations.CreateModel(
name="FreePayment", name="FreePayment",
...@@ -949,7 +945,7 @@ class Migration(migrations.Migration): ...@@ -949,7 +945,7 @@ class Migration(migrations.Migration):
), ),
), ),
], ],
options={"verbose_name", "Free payment"}, options={"verbose_name": "Free payment"},
), ),
migrations.CreateModel( migrations.CreateModel(
name="NotePayment", name="NotePayment",
...@@ -968,6 +964,6 @@ class Migration(migrations.Migration): ...@@ -968,6 +964,6 @@ class Migration(migrations.Migration):
("port", models.PositiveIntegerField(blank=True, null=True)), ("port", models.PositiveIntegerField(blank=True, null=True)),
("id_note", models.PositiveIntegerField(blank=True, null=True)), ("id_note", models.PositiveIntegerField(blank=True, null=True)),
], ],
options={"verbose_name", "NoteKfet"}, options={"verbose_name": "NoteKfet"},
), ),
] ]
...@@ -522,7 +522,7 @@ class Migration(migrations.Migration): ...@@ -522,7 +522,7 @@ class Migration(migrations.Migration):
protocol="IPv4", protocol="IPv4",
null=True, null=True,
blank=True, blank=True,
help_text="Network containing the domain's IPv4 range optional).", help_text="Network containing the domain's IPv4 range (optional).",
), ),
), ),
( (
...@@ -570,8 +570,8 @@ class Migration(migrations.Migration): ...@@ -570,8 +570,8 @@ class Migration(migrations.Migration):
("view_iptype", "Can view an IP type object"), ("view_iptype", "Can view an IP type object"),
("use_all_iptype", "Can use all IP types"), ("use_all_iptype", "Can use all IP types"),
), ),
"verbose_name": "Ip type", "verbose_name": "IP type",
"verbose_name_plural": "Ip types", "verbose_name_plural": "IP types",
}, },
), ),
migrations.CreateModel( migrations.CreateModel(
...@@ -1108,7 +1108,6 @@ class Migration(migrations.Migration): ...@@ -1108,7 +1108,6 @@ class Migration(migrations.Migration):
), ),
], ],
options={ options={
"unique_together": (("name", "extension"),),
"permissions": ( "permissions": (
("view_domain", "Can view a domain object"), ("view_domain", "Can view a domain object"),
("change_ttl", "Can change the TTL of a domain object"), ("change_ttl", "Can change the TTL of a domain object"),
......
...@@ -431,8 +431,10 @@ class Migration(migrations.Migration): ...@@ -431,8 +431,10 @@ class Migration(migrations.Migration):
name="OptionalUser", name="OptionalUser",
bases=(re2o.mixins.AclMixin, models.Model), bases=(re2o.mixins.AclMixin, models.Model),
options={ options={
"permissions": (("view_optionaluser", "Can view the user options"),), "permissions": (
"verbose_name": "user options", ("view_optionaluser", "Can view the user preferences"),
),
"verbose_name": "user preferences",
}, },
fields=[ fields=[
( (
...@@ -446,10 +448,30 @@ class Migration(migrations.Migration): ...@@ -446,10 +448,30 @@ class Migration(migrations.Migration):
), ),
("is_tel_mandatory", models.BooleanField(default=True)), ("is_tel_mandatory", models.BooleanField(default=True)),
("gpg_fingerprint", models.BooleanField(default=True)), ("gpg_fingerprint", models.BooleanField(default=True)),
("all_can_create_club", models.BooleanField(default=False)), (
("all_can_create_adherent", models.BooleanField(default=False)), "all_can_create_club",
("self_change_shell", models.BooleanField(default=False)), models.BooleanField(
("self_change_pseudo", models.BooleanField(default=True)), default=False, help_text="Users can create a club."
),
),
(
"all_can_create_adherent",
models.BooleanField(
default=False, help_text="Users can create a member."
),
),
(
"self_change_shell",
models.BooleanField(
default=False, help_text="Users can edit their shell."
),
),
(
"self_change_pseudo",
models.BooleanField(
default=True, help_text="Users can edit their pseudo."
),
),
( (
"self_room_policy", "self_room_policy",
models.CharField( models.CharField(
...@@ -466,7 +488,13 @@ class Migration(migrations.Migration): ...@@ -466,7 +488,13 @@ class Migration(migrations.Migration):
max_length=32, max_length=32,
), ),
), ),
("local_email_accounts_enabled", models.BooleanField(default=False)), (
"local_email_accounts_enabled",
models.BooleanField(
default=False,
help_text="Enable local email accounts for users.",
),
),
( (
"local_email_domain", "local_email_domain",
models.CharField( models.CharField(
...@@ -496,13 +524,34 @@ class Migration(migrations.Migration): ...@@ -496,13 +524,34 @@ class Migration(migrations.Migration):
help_text="Users with an email address not yet confirmed will be disabled after this number of days.", help_text="Users with an email address not yet confirmed will be disabled after this number of days.",
), ),
), ),
("self_adhesion", models.BooleanField(default=False)), (
("all_users_active", models.BooleanField(default=False)), "self_adhesion",
models.BooleanField(
default=False,
help_text="A new user can create their account on Re2o.",
),
),
(
"all_users_active",
models.BooleanField(
default=False,
help_text="If True, all new created and connected users are active. If False, only when a valid registration has been paid.",
),
),
( (
"allow_set_password_during_user_creation", "allow_set_password_during_user_creation",
models.BooleanField(default=False), models.BooleanField(
default=False,
help_text="If True, users have the choice to receive an email containing a link to reset their password during creation, or to directly set their password in the page. If False, an email is always sent.",
),
),
(
"allow_archived_connexion",
models.BooleanField(
default=False,
help_text="If True, archived users are allowed to connect.",
),
), ),
("allow_archived_connexion", models.BooleanField(default=False)),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
...@@ -540,12 +589,13 @@ class Migration(migrations.Migration): ...@@ -540,12 +589,13 @@ class Migration(migrations.Migration):
verbose_name="default Time To Live (TTL) for CNAME, A and AAAA records", verbose_name="default Time To Live (TTL) for CNAME, A and AAAA records",
), ),
), ),
("max_lambdauser_aliases", models.IntegerField(default=10)),
], ],
options={ options={
"permissions": ( "permissions": (
("view_optionalmachine", "Can view the machine options"), ("view_optionalmachine", "Can view the machine preferences"),
), ),
"verbose_name": "machine options", "verbose_name": "machine preferences",
}, },
), ),
migrations.CreateModel( migrations.CreateModel(
...@@ -553,9 +603,9 @@ class Migration(migrations.Migration): ...@@ -553,9 +603,9 @@ class Migration(migrations.Migration):
bases=(re2o.mixins.AclMixin, models.Model), bases=(re2o.mixins.AclMixin, models.Model),
options={ options={
"permissions": ( "permissions": (
("view_optionaltopologie", "Can view the topology options"), ("view_optionaltopologie", "Can view the topology preferences"),
), ),
"verbose_name": "topology options", "verbose_name": "topology preferences",
}, },
fields=[ fields=[
( (
...@@ -567,9 +617,27 @@ class Migration(migrations.Migration): ...@@ -567,9 +617,27 @@ class Migration(migrations.Migration):
verbose_name="ID", verbose_name="ID",
), ),
), ),
("switchs_web_management", models.BooleanField(default=False)), (
("switchs_web_management_ssl", models.BooleanField(default=False)), "switchs_web_management",
("switchs_rest_management", models.BooleanField(default=False)), models.BooleanField(
default=False,
help_text="Web management, activated in case of automatic provision.",
),
),
(
"switchs_web_management_ssl",
models.BooleanField(
default=False,
help_text="SSL web management, make sure that a certificate is installed on the switch.",
),
),
(
"switchs_rest_management",
models.BooleanField(
default=False,
help_text="REST management, activated in case of automatic provision.",
),
),
( (
"switchs_provision", "switchs_provision",
models.CharField( models.CharField(
...@@ -611,14 +679,14 @@ class Migration(migrations.Migration): ...@@ -611,14 +679,14 @@ class Migration(migrations.Migration):
( (
"radius_key", "radius_key",
re2o.aes_field.AESEncryptedField( re2o.aes_field.AESEncryptedField(
help_text="Clef radius", max_length=255 help_text="RADIUS key.", max_length=255
), ),
), ),
( (
"comment", "comment",
models.CharField( models.CharField(
blank=True, blank=True,
help_text="Commentaire de cette clef", help_text="Comment for this key.",
max_length=255, max_length=255,
null=True, null=True,
), ),
...@@ -626,9 +694,8 @@ class Migration(migrations.Migration): ...@@ -626,9 +694,8 @@ class Migration(migrations.Migration):
( (
"default_switch", "default_switch",
models.BooleanField( models.BooleanField(
default=True, default=False,
help_text="Clef par défaut des switchs", help_text="Default key for switches.",
unique=True,
), ),
), ),
], ],
...@@ -653,19 +720,19 @@ class Migration(migrations.Migration): ...@@ -653,19 +720,19 @@ class Migration(migrations.Migration):
), ),
( (
"management_id", "management_id",
models.CharField(help_text="Login du switch", max_length=63), models.CharField(help_text="Switch login.", max_length=63),
), ),
( (
"management_pass", "management_pass",
re2o.aes_field.AESEncryptedField( re2o.aes_field.AESEncryptedField(
help_text="Mot de passe", max_length=63 help_text="Password.", max_length=63
), ),
), ),
( (
"default_switch", "default_switch",
models.BooleanField( models.BooleanField(
default=True, default=True,
help_text="Creds par défaut des switchs", help_text="Default credentials for switches.",
unique=True, unique=True,
), ),
), ),
...@@ -697,17 +764,16 @@ class Migration(migrations.Migration): ...@@ -697,17 +764,16 @@ class Migration(migrations.Migration):
"days", "days",
models.IntegerField( models.IntegerField(
default=7, default=7,
help_text="Délais entre le mail et la fin d'adhésion", help_text="Delay between the email and the membership's end.",
unique=True, unique=True,
), ),
), ),
( (
"message", "message",
models.CharField( models.TextField(
blank=True, blank=True,
default="", default="",
help_text="Message affiché spécifiquement pour ce rappel", help_text="Message displayed specifically for this reminder.",
max_length=255,
null=True, null=True,
), ),
), ),
...@@ -769,15 +835,15 @@ class Migration(migrations.Migration): ...@@ -769,15 +835,15 @@ class Migration(migrations.Migration):
], ],
options={ options={
"permissions": ( "permissions": (
("view_generaloption", "Can view the general options"), ("view_generaloption", "Can view the general preferences"),
), ),
"verbose_name": "general options", "verbose_name": "general preferences",
}, },
), ),
migrations.CreateModel( migrations.CreateModel(
name="Service", name="Service",
options={ options={
"permissions": (("view_service", "Can view the service options"),), "permissions": (("view_service", "Can view the service preferences"),),
"verbose_name": "service", "verbose_name": "service",
"verbose_name_plural": "services", "verbose_name_plural": "services",
}, },
...@@ -794,7 +860,7 @@ class Migration(migrations.Migration): ...@@ -794,7 +860,7 @@ class Migration(migrations.Migration):
("name", models.CharField(max_length=32)), ("name", models.CharField(max_length=32)),
("url", models.URLField()), ("url", models.URLField()),
("description", models.TextField()), ("description", models.TextField()),
("image", models.ImageField(upload_to="logo")), ("image", models.ImageField(blank=True, upload_to="logo")),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
...@@ -813,7 +879,7 @@ class Migration(migrations.Migration): ...@@ -813,7 +879,7 @@ class Migration(migrations.Migration):
"address", "address",
models.EmailField( models.EmailField(
default="contact@example.org", default="contact@example.org",
help_text="Contact email adress", help_text="Contact email address.",
max_length=254, max_length=254,
), ),
), ),
...@@ -821,7 +887,7 @@ class Migration(migrations.Migration): ...@@ -821,7 +887,7 @@ class Migration(migrations.Migration):
"commentary", "commentary",
models.CharField(