Pull requests

#30 Declined
Repository
mrginglymus mrginglymus
Branch
default
Repository
ubernostrum ubernostrum
Branch
default

Django 1.5 compatibility with custom User models

Author
  1. Bill Collins
Reviewers
Description

Allows registration to work with custom user models (does not fix direct_to_template).

Comments (23)

    1. Alan Boyce

      I'm just curious as to what this means. You're not rejecting the patch because of it's contents, but because too many people hit the approve button?

      Should he resubmit and ask people not to hit the approve button?

    2. Bertrand Bordage

      So, what could we do to get Django 1.5 compatibility? The main new feature of 1.5 being the configurable User model, django-registration should have been one of the first packages to be compatible with it.

      I don't want to bother you, but acting like that is disrespectful for the nearly thousand followers of django-registration (one of the most followed django project!). If you don't want to manage this package anymore, give this responsability to someone else, but please, don't ruin it like this. No one wants to see a "django-registration3" fork as the future of "django-registration"…

      1. James Bennett repo owner

        Well, I've said multiple times that I'll be working on this during the PyCon sprints. So, you know, how about giving me a chance to do what I said I'd do? Because honestly, every time somebody ignores me saying that and starts spamming this thing again, I get more and more tempted to just move the repository off Bitbucket in order to cut off peoples' ability to abuse it.

        1. Ben Jeffrey

          With all due respect, if you honestly feel this way then perhaps it would be better that you take your repository offline, and let someone else maintain django-registration on PyPI.

          We all appreciate that you might not have much spare time, but consistently ignoring and refusing to accept working patches is hurting everyone's experience. There are already 365 forks of this repo, and a number of open pull-requests, all fixing this bug, but you control the PyPI package. I (and everyone else using custom user models) cannot use django-registration from pip without further research and work. Unless I fork the repo, I can't deploy a project using django-registration.

          Since you see all this volunteer work as "spam", perhaps it would be better to stop it at the source? Implement the fix and push a point-release? Please?

          You hold the keys to distributing a highly-regarded and useful open-source project and, like it or not, that does carry responsibilities to maintain it in a timely manner, and not to alienate the people who use it.

  1. migajek

    well, django 1.5 is right behind the corner. Is that the way you "solve" the compatibility problem? Please leave the pull request at least so the users can find it easy and patch themselves.

  2. Jacky Alciné

    It's simple, guys. Apply the patch and keep moving. Since the concept of open development doesn't seem to apply here, it's best if we just mitiage the traffic here.

  3. Patrick Robertson

    This patch isn't right. You should never call get_user_model outside of a method (when importing). It is a fatal error in Django 1.7, and causes all sorts of import problems.

    Plus, it's not exactly DRY

      1. Patrick Robertson

        from django.conf import settings

        user = models.ForeignKey(settings.AUTH_USER_MODEL, unique=True, verbose_name=_('user’))

        Upgrade to Django 1.7 and you’ll see the warning/error. My for using User outside of a ForeignKey in my local branch of django-registration was to do:

        try: from django.contrib.auth import get_user_model User = get_user_model except AttributeError: def User(): from django.contrib.auth.models import User as _User return _User

        … later on in my code

        User().objects.filter(name=“something”)... …

        If you’re gonna make a pull request, try and keep it DRY - put this code in one file then import this from all other files:

        forms.py

        from registration.models import User

        … User().objects.filter(…)

        1. rda

          Good approach. I think User isn't good name for this compatibility function. Looks like you create an instance of User model and then try to access objects attribute.

            1. rda

              Maybe, original name is good enough ;-)

              try:
                  from django.contrib.auth import get_user_model
              except ImportError:
                  def get_user_model():
                      from django.contrib.auth.models import User
                      return User
              

              Usage: get_user_model().objects.all()

  4. Ronin Dusette

    I think the reason that people are really wanting this change implemented, is that a bunch of us use your app. :) It is annoying, but consider them compliments. It is the nature of the beast when you create something popular and useful. haha. I am very much looking forward to this change, along with Django 1.7's release.