1. jordanreiter
  2. django-profiles

Commits

Jordan Reiter  committed f00b015

Set user in the form object

  • Participants
  • Parent commits c219625
  • Branches default

Comments (0)

Files changed (1)

File profiles/utils.py

View file
  • Ignore whitespace
         class Meta:
             model = profile_mod
             exclude = ('user',) # User will be filled in by the view.
+        
+        def __init__(self, *args, **kwargs):
+            self.user = kwargs.pop('user', None)
+            super(_ProfileForm, self).__init__(*args, **kwargs)
+
     return _ProfileForm