matthiask / plata

Plata - the lean and mean Django-based Shop
https://plata-django-shop.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
202 stars 63 forks source link

Adds partial support for Django 1.5's custom user models #50

Closed rofrankel closed 11 years ago

rofrankel commented 11 years ago

This adds support for Django 1.5's custom user models, though it assumes that either the custom user model is compatible with the contrib.auth User model (this should include nearly all cases in which the custom model is a subclass of AbstractBaseUser).

All current tests pass on both Django 1.5 beta 2 and Django 1.4.3. Any suggestions for new tests?

meric commented 11 years ago

It looks like it also assumes the custom user model has first_name, last_name and email (which Django 1.4 User has), which isn't implemented in AbstractBaseUser.

https://docs.djangoproject.com/en/dev/topics/auth/#django.contrib.auth.models.AbstractBaseUser

rofrankel commented 11 years ago

You are correct - I should have said AbstractUser (which, for some reason, isn't in the docs).

https://github.com/django/django/blob/47e1df896b17aaaa97b73ef64010a7df4ea3d8d6/django/contrib/auth/models.py#L370

meric commented 11 years ago

I see. :)

matthiask commented 11 years ago

Very nice, thanks!

A good step towards solving the issues discussed in #48.

rofrankel commented 11 years ago

My pleasure, thank you for writing Plata!