8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-05 09:26:27 +00:00

Fix miscellanous model creation mistakes.

This commit is contained in:
Hugo Levy-Falk 2020-12-30 17:08:42 +01:00 committed by chirac
parent 7792be978d
commit 33497893d8
5 changed files with 190 additions and 71 deletions

View file

@ -445,7 +445,7 @@ class Migration(migrations.Migration):
verbose_name="ID",
),
),
("date", models.DateTimeField(auto_now_add=True, verbose_name="Date")),
("date", models.DateTimeField(auto_now_add=True, verbose_name="date")),
],
bases=(
re2o.mixins.RevMixin,
@ -506,14 +506,14 @@ class Migration(migrations.Migration):
),
(
"recipient",
models.CharField(max_length=255, verbose_name="Recipient"),
models.CharField(max_length=255, verbose_name="recipient"),
),
(
"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")),
("paid", models.BooleanField(verbose_name="Paid")),
("address", models.CharField(max_length=255, verbose_name="address")),
("paid", models.BooleanField(default=False, verbose_name="paid")),
(
"remark",
models.TextField(verbose_name="remark", blank=True, null=True),
@ -521,7 +521,9 @@ class Migration(migrations.Migration):
],
bases=("cotisations.baseinvoice",),
options={
"permissions": (("view_custominvoice", "Can view a custom invoice"),)
"permissions": (
("view_custominvoice", "Can view a custom invoice object"),
)
},
),
migrations.CreateModel(
@ -541,7 +543,7 @@ class Migration(migrations.Migration):
(
"validity",
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):
"duration_days_connection",
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)",
),
),
@ -602,7 +603,6 @@ class Migration(migrations.Migration):
"duration_days_membership",
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)",
),
),
@ -651,28 +651,24 @@ class Migration(migrations.Migration):
(
"duration_connection",
models.PositiveIntegerField(
default=0, verbose_name="duration of the connection (in months)"
verbose_name="duration of the connection (in months)"
),
),
(
"duration_days_connection",
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)",
),
),
(
"duration_membership",
models.PositiveIntegerField(
default=0, verbose_name="duration of the membership (in months)"
verbose_name="duration of the membership (in months)"
),
),
(
"duration_days_membership",
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)",
),
),
@ -866,7 +862,7 @@ class Migration(migrations.Migration):
),
),
],
options={"verbose_name", "user balance"},
options={"verbose_name": "user balance"},
),
migrations.CreateModel(
name="ChequePayment",
@ -882,7 +878,7 @@ class Migration(migrations.Migration):
),
),
],
options={"verbose_name", "cheque"},
options={"verbose_name": "cheque"},
),
migrations.CreateModel(
name="ComnpayPayment",
@ -933,7 +929,7 @@ class Migration(migrations.Migration):
),
),
],
options={"verbose_name", "ComNpay"},
options={"verbose_name": "ComNpay"},
),
migrations.CreateModel(
name="FreePayment",
@ -949,7 +945,7 @@ class Migration(migrations.Migration):
),
),
],
options={"verbose_name", "Free payment"},
options={"verbose_name": "Free payment"},
),
migrations.CreateModel(
name="NotePayment",
@ -968,6 +964,6 @@ class Migration(migrations.Migration):
("port", models.PositiveIntegerField(blank=True, null=True)),
("id_note", models.PositiveIntegerField(blank=True, null=True)),
],
options={"verbose_name", "NoteKfet"},
options={"verbose_name": "NoteKfet"},
),
]

View file

@ -522,7 +522,7 @@ class Migration(migrations.Migration):
protocol="IPv4",
null=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):
("view_iptype", "Can view an IP type object"),
("use_all_iptype", "Can use all IP types"),
),
"verbose_name": "Ip type",
"verbose_name_plural": "Ip types",
"verbose_name": "IP type",
"verbose_name_plural": "IP types",
},
),
migrations.CreateModel(
@ -1108,7 +1108,6 @@ class Migration(migrations.Migration):
),
],
options={
"unique_together": (("name", "extension"),),
"permissions": (
("view_domain", "Can view a domain object"),
("change_ttl", "Can change the TTL of a domain object"),

View file

@ -431,8 +431,10 @@ class Migration(migrations.Migration):
name="OptionalUser",
bases=(re2o.mixins.AclMixin, models.Model),
options={
"permissions": (("view_optionaluser", "Can view the user options"),),
"verbose_name": "user options",
"permissions": (
("view_optionaluser", "Can view the user preferences"),
),
"verbose_name": "user preferences",
},
fields=[
(
@ -446,10 +448,30 @@ class Migration(migrations.Migration):
),
("is_tel_mandatory", 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)),
("self_change_shell", models.BooleanField(default=False)),
("self_change_pseudo", models.BooleanField(default=True)),
(
"all_can_create_club",
models.BooleanField(
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",
models.CharField(
@ -466,7 +488,13 @@ class Migration(migrations.Migration):
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",
models.CharField(
@ -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.",
),
),
("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",
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(
@ -540,12 +589,13 @@ class Migration(migrations.Migration):
verbose_name="default Time To Live (TTL) for CNAME, A and AAAA records",
),
),
("max_lambdauser_aliases", models.IntegerField(default=10)),
],
options={
"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(
@ -553,9 +603,9 @@ class Migration(migrations.Migration):
bases=(re2o.mixins.AclMixin, models.Model),
options={
"permissions": (
("view_optionaltopologie", "Can view the topology options"),
("view_optionaltopologie", "Can view the topology preferences"),
),
"verbose_name": "topology options",
"verbose_name": "topology preferences",
},
fields=[
(
@ -567,9 +617,27 @@ class Migration(migrations.Migration):
verbose_name="ID",
),
),
("switchs_web_management", models.BooleanField(default=False)),
("switchs_web_management_ssl", models.BooleanField(default=False)),
("switchs_rest_management", models.BooleanField(default=False)),
(
"switchs_web_management",
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",
models.CharField(
@ -611,14 +679,14 @@ class Migration(migrations.Migration):
(
"radius_key",
re2o.aes_field.AESEncryptedField(
help_text="Clef radius", max_length=255
help_text="RADIUS key.", max_length=255
),
),
(
"comment",
models.CharField(
blank=True,
help_text="Commentaire de cette clef",
help_text="Comment for this key.",
max_length=255,
null=True,
),
@ -626,9 +694,8 @@ class Migration(migrations.Migration):
(
"default_switch",
models.BooleanField(
default=True,
help_text="Clef par défaut des switchs",
unique=True,
default=False,
help_text="Default key for switches.",
),
),
],
@ -653,19 +720,19 @@ class Migration(migrations.Migration):
),
(
"management_id",
models.CharField(help_text="Login du switch", max_length=63),
models.CharField(help_text="Switch login.", max_length=63),
),
(
"management_pass",
re2o.aes_field.AESEncryptedField(
help_text="Mot de passe", max_length=63
help_text="Password.", max_length=63
),
),
(
"default_switch",
models.BooleanField(
default=True,
help_text="Creds par défaut des switchs",
help_text="Default credentials for switches.",
unique=True,
),
),
@ -697,17 +764,16 @@ class Migration(migrations.Migration):
"days",
models.IntegerField(
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,
),
),
(
"message",
models.CharField(
models.TextField(
blank=True,
default="",
help_text="Message affiché spécifiquement pour ce rappel",
max_length=255,
help_text="Message displayed specifically for this reminder.",
null=True,
),
),
@ -769,15 +835,15 @@ class Migration(migrations.Migration):
],
options={
"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(
name="Service",
options={
"permissions": (("view_service", "Can view the service options"),),
"permissions": (("view_service", "Can view the service preferences"),),
"verbose_name": "service",
"verbose_name_plural": "services",
},
@ -794,7 +860,7 @@ class Migration(migrations.Migration):
("name", models.CharField(max_length=32)),
("url", models.URLField()),
("description", models.TextField()),
("image", models.ImageField(upload_to="logo")),
("image", models.ImageField(blank=True, upload_to="logo")),
],
),
migrations.CreateModel(
@ -813,7 +879,7 @@ class Migration(migrations.Migration):
"address",
models.EmailField(
default="contact@example.org",
help_text="Contact email adress",
help_text="Contact email address.",
max_length=254,
),
),
@ -821,7 +887,7 @@ class Migration(migrations.Migration):
"commentary",
models.CharField(
blank=True,
help_text="Description of the associated email adress.",
help_text="Description of the associated email address.",
max_length=256,
null=True,
),
@ -857,9 +923,9 @@ class Migration(migrations.Migration):
),
],
options={
"verbose_name": "Mandate",
"verbose_name_plural": "Mandates",
"permissions": (("view_mandate", "Can view a mandate"),),
"verbose_name": "mandate",
"verbose_name_plural": "mandates",
"permissions": (("view_mandate", "Can view a mandate object"),),
},
bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model),
),
@ -1119,6 +1185,7 @@ class Migration(migrations.Migration):
),
),
],
options={"verbose_name": "subscription preferences"},
),
migrations.CreateModel(
name="DocumentTemplate",

View file

@ -12,7 +12,7 @@ import re2o.field_permissions
class Migration(migrations.Migration):
initial = True
dependencies = [("machines", "0001_squashed_0108")]
dependencies = [("machines", "0001_model_creation")]
replaces = [
("users", "0001_initial"),
("users", "0002_auto_20160630_2301"),
@ -787,7 +787,7 @@ class Migration(migrations.Migration):
options={
"permissions": (("view_port", "Can view a port object"),),
"verbose_name": "port",
"verbose_name_plural": "port",
"verbose_name_plural": "ports",
},
),
migrations.CreateModel(
@ -927,4 +927,27 @@ class Migration(migrations.Migration):
"verbose_name_plural": "port profiles",
},
),
migrations.CreateModel(
name="Room",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=255)),
("details", models.CharField(blank=True, max_length=255)),
],
options={
"verbose_name": "room",
"verbose_name_plural": "rooms",
"ordering": ["building__name"],
"permissions": (("view_room", "Can view a room object"),),
},
bases=(re2o.mixins.AclMixin, re2o.mixins.RevMixin, models.Model),
),
]

View file

@ -12,9 +12,9 @@ import users.models
class Migration(migrations.Migration):
dependencies = []
dependencies = [('auth', '0008_alter_user_username_max_length')]
initial = True
run_before = [('reversion', '0001_squashed_0004_auto_20160611_1202')]
run_before = [("reversion", "0001_squashed_0004_auto_20160611_1202")]
# We replace everything.
replaces = [
("users", "0001_initial"),
@ -542,6 +542,28 @@ class Migration(migrations.Migration):
),
("email_change_date", models.DateTimeField(auto_now_add=True)),
("theme", models.CharField(max_length=255, default="default.css")),
(
"is_superuser",
models.BooleanField(
default=False,
help_text="Designates that this user has all permissions without explicitly assigning them.",
verbose_name="superuser status",
),
),
(
"last_login",
models.DateTimeField(
blank=True, null=True, verbose_name="last login"
),
),
(
"password",
models.CharField(
max_length=128, verbose_name="password"
),
),
("groups", models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
("user_permissions", models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'))
],
options={
"permissions": (
@ -646,6 +668,18 @@ class Migration(migrations.Migration):
"comment",
models.CharField(help_text="Comment.", max_length=255, blank=True),
),
(
"last_login",
models.DateTimeField(
blank=True, null=True, verbose_name="last login"
),
),
(
"password",
models.CharField(
max_length=128, verbose_name="password"
),
),
],
options={
"permissions": (
@ -685,12 +719,12 @@ class Migration(migrations.Migration):
),
fields=[
(
"id",
"group_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
auto_created=True,
primary_key=True,
on_delete=django.db.models.deletion.CASCADE,
serialize=False,
to="auth.Group",
),