Pull requests

#36 Declined
Repository
eire1130
Branch
default
Repository
ubernostrum
Branch
default

fixes for 1.5, use TemplateView and the new User module.

Author
  1. James Reynolds
Reviewers
Description

This is basically a combination of the cbv fork for (direct_to_template is deprecated) and the rejected pull request #30 for compatibility for the new User model.

Without the above, dev's can't use this package for Django 1.5

  • Learn about pull requests

Comments (5)

  1. Erik Wickstrom

    My understanding is that this pull request is no longer necessary based on the commits that were made a couple of weeks ago. I've deployed trunk into production with Django 1.5 and everything is working very well! Updating your backends to use the new class based view system only takes about 20 minutes. What we really need is a new release pushed to pypi.

    1. bleddy

      Were you using a custom user model? models.py has RegistrationProfile with an FK directly on User instead of using get_user_model, so this package is unusable for all those with custom user models.

      1. mdeboard

        It's not unusable but it does require subclassing various classes. Unfortunately the subclassing will basically be a copy & paste of the existing classes.

        1. bleddy

          If you install this app while using a custom user model, Django gives you the "Manager isn't available; User has been swapped for 'app.UserModel' error, even before you syncdb. This is coming from the model itself, so I don't think we can subclass this problem away, unless I'm missing something. Subclassing the CBVs works brilliantly, and the whole thing is great once you edit model.py to use get_user_model...

          1. James Reynolds author

            The fix here for the package is fairly simple, and without breaking the API. All that needs to be done is something similar to what I did

            try:
                from django.contrib.auth import get_user_model
            except ImportError: # django < 1.5
                from django.contrib.auth.models import User
            else:
                User = get_user_model()
            

            But, someone else will have to do that. The last time I made a pull request on this package it was rejected for spam (pull requests generate emails, although I don't think I have control over that). If I could control whether people are liking or not, I would (likes also generate emails), but maybe the package maintainer can take it up? Not sure. In any event, I just use my fork with upstream to the main and that works for my purposes.

            That said, I haven't tested custom user models, but I'm fairly certain the above approach should work in these circumstances.

            You might also need to do this forms.py as well, by the way.