Django-jet: Dashboard, Bookmark and PinnedApplication models should use a ForeignKey to User

Created on 28 Mar 2017  路  13Comments  路  Source: geex-arts/django-jet

I have a custom user model which swaps the id field with a UUID field. I tried setting up the dashboard and got a DataError

To reproduce

  • Create a custom user model with id as uuid field
import uuid
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
class CustomUser(AbstractBaseUser, PermissionsMixin):
    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
  • Set AUTH_USER_MODEL to this model
  • Try to access the dashboard

You will see an error similar to this
(1264, "Out of range value for column 'user' at row 1")

To fix

replace any user fields with
user = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('user'))
then change any references of user.pk to user

Most helpful comment

Note: We are maintaining a fork here at the moment: https://github.com/reckonsys/rs-django-jet addressing these issues. ONLY for UUID fields.

All 13 comments

@f1nality What do you think about this?

Please come to the django-jet Discord server so we can organize if you like:

Welcome! 馃槃

Same issue here.

Ok, @rickydunlop Can you make a PR in my Fork?

@SalahAdDin Yeah sure can, what fork its yours? I don't see one on your Github page

Oh, it is a jet_community fork now.

It looks like someone has already opened a PR with the patches I made
https://github.com/jet-community/django-jet/pull/20

@rickydunlop Can you help us with reviewing? After it i will merge it.

@rickydunlop @SalahAdDin It will be great if you guys can merge it. Let me know if you need any help.

We have not control here, only in the other repository.

Note: We are maintaining a fork here at the moment: https://github.com/reckonsys/rs-django-jet addressing these issues. ONLY for UUID fields.

@govindsharma7 We also had a fork, are you working just in the UUID fields? No more features, right?

@SalahAdDin Right now I have worked on UUID fields only.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pwndr00t picture pwndr00t  路  4Comments

imdario picture imdario  路  5Comments

seenu4linux picture seenu4linux  路  3Comments

ramses132 picture ramses132  路  3Comments

uroybd picture uroybd  路  5Comments