summaryrefslogtreecommitdiff
path: root/gnowsys-ndf/gnowsys_ndf/ndf/views/person.py
diff options
context:
space:
mode:
Diffstat (limited to 'gnowsys-ndf/gnowsys_ndf/ndf/views/person.py')
-rw-r--r--gnowsys-ndf/gnowsys_ndf/ndf/views/person.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/views/person.py b/gnowsys-ndf/gnowsys_ndf/ndf/views/person.py
index aecff15..a2adc0e 100644
--- a/gnowsys-ndf/gnowsys_ndf/ndf/views/person.py
+++ b/gnowsys-ndf/gnowsys_ndf/ndf/views/person.py
@@ -44,7 +44,7 @@ def person_detail(request, group_id, app_id=None, app_set_id=None, app_set_insta
if group_ins:
group_id = str(group_ins._id)
else :
- auth = node_collection.one({'_type': 'Author', 'name': unicode(request.user.username) })
+ # auth = node_collection.one({'_type': 'Author', 'name': unicode(request.user.username) })
if auth :
group_id = str(auth._id)
else :
@@ -86,8 +86,11 @@ def person_detail(request, group_id, app_id=None, app_set_id=None, app_set_insta
agency_type = auth.agency_type
agency_type_node = node_collection.one({'_type': "GSystemType", 'name': agency_type}, {'collection_set': 1})
if agency_type_node:
- for eachset in agency_type_node.collection_set:
- app_collection_set.append(node_collection.one({"_id": eachset}, {'_id': 1, 'name': 1, 'type_of': 1}))
+ # for eachset in agency_type_node.collection_set:
+ # app_collection_set.append(node_collection.one({"_id": eachset}, {'_id': 1, 'name': 1, 'type_of': 1}))
+ #loop replaced by a list comprehension
+ app_collection_set=[node_collection.one({"_id": eachset}, {'_id': 1, 'name': 1, 'type_of': 1}) for eachset in agency_type_node.collection_set]
+
if app_set_id:
person_gst = node_collection.one({'_type': "GSystemType", '_id': ObjectId(app_set_id)})#, {'name': 1, 'type_of': 1})
@@ -115,8 +118,10 @@ def person_detail(request, group_id, app_id=None, app_set_id=None, app_set_insta
]
widget_for = get_widget_built_up_data(widget_for, person_gs)
- for each in univ_cur:
- univ_list.append(each)
+# for each in univ_cur:
+# univ_list.append(each)
+ #loop replaced by a list comprehension
+ univ_list=[each for each in univ_cur]
elif title == "Program Officer" or title == "Voluntary Teacher":