Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update models.py GUID TO CharField To fix Postgresql issues #10

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions magic_link/migrations/0005_alter_magiclink_token.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.1.4 on 2023-12-02 14:04

from django.db import migrations, models
import uuid


class Migration(migrations.Migration):

dependencies = [
("magic_link", "0004_remove_magiclinkuse_link_is_valid"),
]

operations = [
migrations.AlterField(
model_name="magiclink",
name="token",
field=models.CharField(
default=uuid.uuid4,
editable=False,
help_text="Unique login token",
max_length=36,
unique=True,
),
),
]
4 changes: 2 additions & 2 deletions magic_link/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class MagicLink(models.Model):
user = models.ForeignKey(
settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name="magic_links"
)
token = models.UUIDField(
default=uuid.uuid4, editable=False, unique=True, help_text="Unique login token"
token = models.CharField(
default=uuid.uuid4, editable=False, unique=True, help_text="Unique login token", max_length=36
)
redirect_to = models.CharField(
help_text="URL to which user will be redirected after logging in. ('/')",
Expand Down