1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-24 21:34:41 +03:00

Fixed token length and remade migration

This commit is contained in:
Adolfo Gómez García 2021-11-12 10:48:11 +01:00
parent eeae98ca79
commit 85aab86b02
2 changed files with 9 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# Generated by Django 3.2.8 on 2021-11-11 13:16
# Generated by Django 3.2.8 on 2021-11-12 10:47
from django.db import migrations, models
import django.db.models.deletion
@ -11,11 +11,16 @@ class Migration(migrations.Migration):
]
operations = [
migrations.AlterField(
model_name='service',
name='token',
field=models.CharField(blank=True, default=None, max_length=64, null=True, unique=True),
),
migrations.CreateModel(
name='ServiceTokenAlias',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('alias', models.CharField(max_length=128)),
('alias', models.CharField(max_length=64, unique=True)),
('service', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='aliases', to='uds.service')),
],
),

View File

@ -62,7 +62,7 @@ class ServiceTokenAlias(models.Model):
service = models.ForeignKey(
'Service', on_delete=models.CASCADE, related_name='aliases'
)
alias = models.CharField(max_length=128)
alias = models.CharField(max_length=64, unique=True)
def __str__(self):
return self.alias
@ -85,7 +85,7 @@ class Service(ManagedObjectModel, TaggingMixin): # type: ignore
)
token = models.CharField(
max_length=32, default=None, null=True, blank=True, unique=True
max_length=64, default=None, null=True, blank=True, unique=True
)
_cachedInstance: typing.Optional['services.Service'] = None