mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-22 06:19:38 +02:00
Add UUID for user model
This commit is contained in:
parent
96eb73a224
commit
a08a91388d
2 changed files with 25 additions and 0 deletions
|
@ -0,0 +1,23 @@
|
|||
# Generated by Django 5.0.8 on 2024-08-11 12:26
|
||||
|
||||
import uuid
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('users', '0002_alter_customuser_profile_pic'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='customuser',
|
||||
name='id',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='customuser',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True),
|
||||
),
|
||||
]
|
|
@ -1,9 +1,11 @@
|
|||
import uuid
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
from django.db import models
|
||||
from django_resized import ResizedImageField
|
||||
|
||||
class CustomUser(AbstractUser):
|
||||
profile_pic = ResizedImageField(force_format="WEBP", quality=75, null=True, blank=True, upload_to='profile-pics/')
|
||||
uuid = models.UUIDField(default=uuid.uuid4, editable=False, unique=True, primary_key=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.username
|
Loading…
Add table
Add a link
Reference in a new issue