fix: one user can have multiple instances; OneToOneField -> ForeignKey

wip-payments
Aravinth Manivannan 2022-06-18 21:54:53 +05:30
parent 627087cf0e
commit 2fb1a3d0d1
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
3 changed files with 28 additions and 2 deletions

View File

@ -0,0 +1,23 @@
# Generated by Django 4.0.3 on 2022-06-18 15:11
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("dash", "0004_instanceconfiguration_rent"),
]
operations = [
migrations.AlterField(
model_name="instance",
name="owned_by",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL
),
),
]

View File

@ -77,7 +77,7 @@ class Instance(models.Model):
Hostea instances
"""
owned_by = models.OneToOneField(User, on_delete=models.CASCADE)
owned_by = models.ForeignKey(User, on_delete=models.CASCADE)
ID = models.AutoField(primary_key=True)
name = models.CharField(
"Name of this Instance. Also Serves as subdomain",

View File

@ -136,7 +136,10 @@ DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
HOSTEA = {
"RESTRICT_NEW_INTEGRATION_INSTALLATION": True,
"INSTANCE_MAINTAINER_CONTACT": "contact@hostea.example.org",
"ACCOUNTS": {"MAX_VERIFICATION_TOLERANCE_PERIOD": 60 * 60 * 24}, # in seconds
"ACCOUNTS": {
"MAX_VERIFICATION_TOLERANCE_PERIOD": 60 * 60 * 24, # in seconds
"SUDO_TTL": 60 * 5,
},
"META": {
"GITEA_INSTANCE": "https://gitea.hostea.org", # meta Gitea insatnce
"GITEA_ORG_NAME": "Hostea", # Organisation name on Hostea meta instance