app/soc/views/models/organization.py
changeset 1641 c2201decd4b4
parent 1605 df05cd289b2f
child 1668 e3780ee24322
equal deleted inserted replaced
1640:c63fb0240203 1641:c2201decd4b4
    22     '"Sverre Rabbelier" <sverre@rabbelier.nl>',
    22     '"Sverre Rabbelier" <sverre@rabbelier.nl>',
    23     '"Lennard de Rijk" <ljvderijk@gmail.com>',
    23     '"Lennard de Rijk" <ljvderijk@gmail.com>',
    24   ]
    24   ]
    25 
    25 
    26 
    26 
    27 from google.appengine.api import users
       
    28 
       
    29 from django import forms
    27 from django import forms
       
    28 from django.utils.translation import ugettext
    30 
    29 
    31 from soc.logic import cleaning
    30 from soc.logic import cleaning
    32 from soc.logic import dicts
    31 from soc.logic import dicts
    33 from soc.logic import accounts
    32 from soc.logic import accounts
    34 from soc.logic.models import mentor as mentor_logic
    33 from soc.logic.models import mentor as mentor_logic
   162       kwargs: the Key Fields for the specified entity
   161       kwargs: the Key Fields for the specified entity
   163     """
   162     """
   164 
   163 
   165     list_params = params.copy()
   164     list_params = params.copy()
   166     list_params['list_action'] = (redirects.getRequestRedirectForRole, 'mentor')
   165     list_params['list_action'] = (redirects.getRequestRedirectForRole, 'mentor')
   167     list_params['list_description'] = ('Choose an Organization which '
   166     list_params['list_description'] = ugettext('Choose an Organization which '
   168         'you want to become a Mentor for.')
   167         'you want to become a Mentor for.')
   169 
   168 
   170     filter = {'scope_path': kwargs['scope_path'],
   169     filter = {'scope_path': kwargs['scope_path'],
   171               'status' : 'active'}
   170               'status' : 'active'}
   172 
   171 
   188 
   187 
   189     filter = {'org' : org_entity,
   188     filter = {'org' : org_entity,
   190               'status': ['new', 'pending', 'accepted']}
   189               'status': ['new', 'pending', 'accepted']}
   191 
   190 
   192     list_params = student_proposal_view.view.getParams().copy()
   191     list_params = student_proposal_view.view.getParams().copy()
   193     list_params['list_description'] = 'List of %s send to %s ' %(
   192     list_params['list_description'] = 'List of %s send to %s ' % (
   194         list_params['name_plural'], org_entity.name)
   193         list_params['name_plural'], org_entity.name)
   195     list_params['list_action'] = (redirects.getPublicRedirect, list_params)
   194     list_params['list_action'] = (redirects.getPublicRedirect, list_params)
   196 
   195 
   197     return self.list(request, access_type=access_type, page_name=page_name,
   196     return self.list(request, access_type=access_type, page_name=page_name,
   198                      params=list_params, filter=filter, **kwargs)
   197                      params=list_params, filter=filter, **kwargs)