allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [12/21] git commit: [#4299] ticket:281 Handle case when field value is string (username), not User object
Date Fri, 22 Mar 2013 22:54:39 GMT
[#4299] ticket:281 Handle case when field value is string (username), not User object


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/bf11c62c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/bf11c62c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/bf11c62c

Branch: refs/heads/master
Commit: bf11c62c5e8fa29fba6fa51d690306fd285199e1
Parents: 4ae5619
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Tue Mar 5 09:57:04 2013 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Fri Mar 22 21:55:16 2013 +0000

----------------------------------------------------------------------
 ForgeTracker/forgetracker/widgets/ticket_form.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bf11c62c/ForgeTracker/forgetracker/widgets/ticket_form.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/widgets/ticket_form.py b/ForgeTracker/forgetracker/widgets/ticket_form.py
index de44f8a..c870686 100644
--- a/ForgeTracker/forgetracker/widgets/ticket_form.py
+++ b/ForgeTracker/forgetracker/widgets/ticket_form.py
@@ -6,6 +6,7 @@ from formencode import validators as fev
 import ew as ew_core
 import ew.jinja2_ew as ew
 
+from allura import model as M
 from forgetracker import model
 
 class TicketCustomFields(ew.CompoundField):
@@ -40,6 +41,8 @@ class GenericTicketForm(ew.SimpleForm):
             ctx = self.context_for(field)
         elif idx == 'assigned_to':
             user = ctx.get('value')
+            if isinstance(user, basestring):
+                user = M.User.by_username(user)
             if user:
                 field.options = [
                     ew.Option(


Mime
View raw message