mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-10 08:01:17 +00:00
AuthToken: barebones implementation
This commit is contained in:
44
bsmain/migrations/0001_initial.py
Normal file
44
bsmain/migrations/0001_initial.py
Normal file
@@ -0,0 +1,44 @@
|
||||
# Generated by Django 4.2.19 on 2025-04-11 11:33
|
||||
|
||||
import bsmain.models
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = []
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="AuthToken",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"token",
|
||||
models.CharField(
|
||||
default=bsmain.models.generate_token,
|
||||
max_length=40,
|
||||
unique=True,
|
||||
validators=[
|
||||
django.core.validators.RegexValidator(
|
||||
message="Token must be a 40-character hexadecimal string.",
|
||||
regex="^[a-f0-9]{40}$",
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
("created_at", models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
),
|
||||
]
|
||||
0
bsmain/migrations/__init__.py
Normal file
0
bsmain/migrations/__init__.py
Normal file
Reference in New Issue
Block a user