[Answered ]-Django userena mugshot widget in a form

2👍

Well it appears that it is quite easy, just follow the steps described in the userena FAQ to add some extra fields to forms and in the new forms.py put something along the lines:

from django import forms    
from userena.forms import SignupForm

class SignupFormExtra(SignupForm):
    avatar = forms.ImageField()

    def save(self):
        new_user = super(SignupFormExtra, self).save()

        profile = new_user.get_profile()
        profile.mugshot = self.cleaned_data['avatar']
        profile.save()

        return new_user

Leave a comment