0

I have a project where I need to extend django's User. The way I did this initially (without Mezzanine) was to subclass Model into a custom Profile which had a one-to-one Field to django's User. Aditionally, to guarantee that each user always has a Profile, I created in my app a receiver that would listen to the user_registered signal. Whenever it was triggered I would just do inside the receiver:

user = kwargs.get('user')
profile = Profile(user=user)
profile.save()

Now with Mezzanine a settings exist called AUTH_PROFILE_MODULE which I just set equal to 'myapp.Profile' and Mezzanine does the Profile creation for me. There are two issues though:

a) On my webapp, every time I access my profile page, I'm getting this:

myapp/venv/local/lib/python2.7/site-packages/mezzanine/accounts/templatetags/accounts_tags.py:70: DeprecationWarning: The use of AUTH_PROFILE_MODULE to define user profiles has been deprecated.
  profile = user.get_profile()

Indeed, AUTH_PROFILE_MODULE used to exist in django but was deprecated. What should I do? Do I ignore the warning since it's Mezzanine, not django, who's using AUTH_PROFILE_MODULE? Or does Mezzanine have a different way to handle profiles now?

b) On my receiver which I had without Mezzanine, I did more things. For example, I initiated Profile vars depending on some environment vars. How can I still do those custom things with Mezzanine? My old receiver isn't working anymore.

Thanks for any help

1 Answers1

0

This question is a bit old, but I think you can safely ignore the warning.

You should be able to accomplish the extra configuration by connecting to the pre or post save signal for the profile model.

joshcartme
  • 2,717
  • 1
  • 22
  • 34