8000 Added slug and uuid field in AppUserModel by Yadavanurag13 · Pull Request #378 · Healthlane-Technologies/Zango · GitHub
[go: up one dir, main page]

Skip to content

Added slug and uuid field in AppUserModel #378

New issue

Have a question about this project? Sign up for a free GitHub acco 8000 unt 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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Yadavanurag13
Copy link
@Yadavanurag13 Yadavanurag13 commented Sep 3, 2024

Added uuid and slug field in AppUserModel.
Added migrations file too...

@deepakdinesh1123 On running the command 8000 python manage.py migrate it is giving "django.db.utils.ProgrammingError: column "slug" of relation "appauth_appusermodel" already exists" This error can you please tell me how to resolve this issue. I tried to fix it but couldn't.

@Yadavanurag13
Copy link
Author

earlier I migrated the model with a slug field only. Ig that's causing the issue here, I tried deleting migrations file but it couldn't help.

Comment on lines 56 to 57
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
slug = models.SlugField(unique=True, blank=True, null=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Yadavanurag13 , thankyou for this PR. I have a small comment.
Id field is already there in the the AbstractZangoUserModel and we don't need to override it. We needed a field of type uuid to track app users across our application and its not easy to guess(unlike id field). The reason we named the field slug is because we are going to use it to identify a user.
So, can you please make the below changes, create new migrations and push the latest changes?

Suggested change
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
slug = models.SlugField(unique=True, blank=True, null=True)
slug = models.UUIDField(default=uuid.uuid4, editable=False)

@Yadavanurag13
Copy link
Author

@DevilsAutumn I have made the required changes. Please review and let me know if any further modifications are required. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0