Skip to content

Commit

Permalink
chore(migrations): alter bearer token expires at
Browse files Browse the repository at this point in the history
Signed-off-by: Thibault Camalon <[email protected]>
  • Loading branch information
thbcmlowk committed Aug 6, 2024
1 parent e37576b commit 72dd097
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions backend/users/migrations/0008_alter_bearertoken_expires_at.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.2.3 on 2024-08-06 16:29

import django.utils.timezone
from django.db import migrations
from django.db import models


class Migration(migrations.Migration):
dependencies = [
("users", "0007_implicitbearertoken_id_and_more"),
]

operations = [
migrations.AlterField(
model_name="bearertoken",
name="expires_at",
field=models.DateTimeField(default=django.utils.timezone.now),
),
]
2 changes: 1 addition & 1 deletion backend/users/models/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class BearerToken(Token):
note = models.TextField(null=True)
expires_at = models.DateTimeField(null=False)
expires_at = models.DateTimeField(null=False, default=timezone.now)
user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name="bearer_tokens", on_delete=models.CASCADE)
id = models.UUIDField(default=uuid.uuid4, editable=False)

Expand Down

0 comments on commit 72dd097

Please sign in to comment.