Set the Mentors list to the user that is suggesting a Task.
--- a/app/soc/modules/ghop/views/models/task.py Thu Oct 22 09:54:01 2009 +0200
+++ b/app/soc/modules/ghop/views/models/task.py Thu Oct 22 10:01:11 2009 +0200
@@ -629,6 +629,16 @@
else:
# TODO: Redirect to standard edit page which already has the ability to
# hide certain fields.
+ # get the mentor entity of the current user that is suggesting the task
+ user_entity = user_logic.logic.getForCurrentAccount()
+
+ filter = {'user': user_entity,
+ 'scope': fields['scope'],
+ 'status': 'active'}
+
+ mentor_entity = ghop_mentor_logic.logic.getForFields(filter, unique=True)
+ fields['mentors'] = [mentor_entity.key()]
+
entity = logic.updateOrCreateFromFields(fields)
redirect = ghop_redirects.getSuggestTaskRedirect(