]> git.ozlabs.org Git - patchwork/blobdiff - apps/patchwork/utils.py
Use django-registration infrastructure
[patchwork] / apps / patchwork / utils.py
index 72eff4f764d81f88d9c2f4be239245b2cdc60c7b..dfe1c92fe3c7c6895f46cdca47e9f2c24b4fed4a 100644 (file)
@@ -19,7 +19,7 @@
 
 
 from patchwork.forms import MultiplePatchForm
-from patchwork.models import Bundle, Project, State
+from patchwork.models import Bundle, Project, State, UserProfile
 from django.conf import settings
 from django.shortcuts import render_to_response, get_object_or_404
 
@@ -88,7 +88,7 @@ class Order(object):
         return q
 
 bundle_actions = ['create', 'add', 'remove']
-def set_bundle(user, action, data, patches, context):
+def set_bundle(user, project, action, data, patches, context):
     # set up the bundle
     bundle = None
     if action == 'create':
@@ -147,7 +147,7 @@ def set_patches(user, project, action, data, patches, context):
     # this may be a bundle action, which doesn't modify a patch. in this
     # case, don't require a valid form, or patch editing permissions
     if action in bundle_actions:
-        errors = set_bundle(user, action, data, patches, context)
+        errors = set_bundle(user, project, action, data, patches, context)
         return (errors, form)
 
     if not form.is_valid():
@@ -191,3 +191,8 @@ def set_patches(user, project, action, data, patches, context):
         context.add_message(str)
 
     return (errors, form)
+
+def userprofile_register_callback(user):
+    profile = UserProfile(user = user)
+    profile.save()
+