]> git.ozlabs.org Git - patchwork/blobdiff - apps/patchwork/utils.py
Add pwclientrc configuration file sample for each project
[patchwork] / apps / patchwork / utils.py
index cecf51282f38aa83d6d7b61f03468dd129b103cd..05e66e26eb0c72bd9b7e0db0378fc9e5d012a1cb 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
 
@@ -40,10 +40,11 @@ def get_patch_ids(d, prefix = 'patch_id'):
 
 class Order(object):
     order_map = {
-        'date':                'date',
-        'name':                'name',
-        'state':       'state__ordering',
-        'submitter':   'submitter__name'
+        'date':         'date',
+        'name':         'name',
+        'state':        'state__ordering',
+        'submitter':    'submitter__name',
+        'delegate':     'delegate__username',
     }
     default_order = 'date'
 
@@ -142,8 +143,6 @@ def set_patches(user, project, action, data, patches, context):
 
     str = ''
 
-    print "action: ", action
-
     # 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:
@@ -191,3 +190,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()
+