feat(settings): add join token
This commit is contained in:
parent
f04e114062
commit
300b932daa
|
@ -0,0 +1,21 @@
|
|||
# Generated by Django 4.2.8 on 2023-12-15 01:30
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
import pretalx_musicrate.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("pretalx_musicrate", "0002_musicratesettings_genre_question_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="musicratesettings",
|
||||
name="join_token",
|
||||
field=models.CharField(
|
||||
default=pretalx_musicrate.models.generate_token, max_length=43
|
||||
),
|
||||
),
|
||||
]
|
|
@ -1,7 +1,13 @@
|
|||
from secrets import token_urlsafe
|
||||
|
||||
from django.db import models
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
def generate_token():
|
||||
return token_urlsafe(32)
|
||||
|
||||
|
||||
class MusicrateSettings(models.Model):
|
||||
event = models.OneToOneField(
|
||||
to="event.Event",
|
||||
|
@ -33,3 +39,4 @@ class MusicrateSettings(models.Model):
|
|||
blank=True,
|
||||
null=True,
|
||||
)
|
||||
join_token = models.CharField(max_length=43, default=generate_token)
|
||||
|
|
Loading…
Reference in New Issue