app/soc/views/models/user.py
changeset 1042 edd125206703
parent 1030 a0081c626acb
child 1047 26fade94886b
equal deleted inserted replaced
1041:dfe21b16c86c 1042:edd125206703
    17 """Views for User profiles.
    17 """Views for User profiles.
    18 """
    18 """
    19 
    19 
    20 __authors__ = [
    20 __authors__ = [
    21     '"Sverre Rabbelier" <sverre@rabbelier.nl>',
    21     '"Sverre Rabbelier" <sverre@rabbelier.nl>',
       
    22     '"Lennard de Rijk" <ljvderijk@gmail.com>',
    22     '"Pawel Solyga" <pawel.solyga@gmail.com>',
    23     '"Pawel Solyga" <pawel.solyga@gmail.com>',
    23   ]
    24   ]
    24 
    25 
    25 
    26 
    26 from google.appengine.api import users
    27 from google.appengine.api import users
    74     new_params['extra_dynaexclude'] = ['former_accounts']
    75     new_params['extra_dynaexclude'] = ['former_accounts']
    75     new_params['create_extra_dynafields'] = {
    76     new_params['create_extra_dynafields'] = {
    76         'clean_link_id': cleaning.clean_user_not_exist('link_id'),
    77         'clean_link_id': cleaning.clean_user_not_exist('link_id'),
    77         'clean_account': cleaning.clean_user_account_not_in_use('account')}
    78         'clean_account': cleaning.clean_user_account_not_in_use('account')}
    78 
    79 
    79     #TODO edit_extra_dynafields => link_id read only
       
    80     new_params['edit_extra_dynafields'] = {
    80     new_params['edit_extra_dynafields'] = {
    81         'link_id': forms.CharField(widget=widgets.ReadOnlyInput(),
    81         'link_id': forms.CharField(widget=widgets.ReadOnlyInput(),
    82                                    required=True),
    82                                    required=True),
    83         'clean_link_id': cleaning.clean_link_id,
    83         'clean_link_id': cleaning.clean_link_id,
    84         'clean_account': cleaning.clean_user_account('account'),
    84         'clean_account': cleaning.clean_user_account('account'),
    93     """See base.View._editGet().
    93     """See base.View._editGet().
    94     """
    94     """
    95 
    95 
    96     # fill in the email field with the data from the entity
    96     # fill in the email field with the data from the entity
    97     form.fields['account'].initial = entity.account.email()
    97     form.fields['account'].initial = entity.account.email()
    98     form.fields['agrees_to_tos'].example_text = self._getToSExampleText()
    98     form.fields['agrees_to_tos'].example_text = self.getToSExampleText()
    99 
    99 
   100     super(View, self)._editGet(request, entity, form)
   100     super(View, self)._editGet(request, entity, form)
   101 
   101 
   102   def _getToSExampleText(self):
   102   def getToSExampleText(self):
   103     """Returns example_text linking to site-wide ToS, or a warning message.
   103     """Returns example_text linking to site-wide ToS, or a warning message.
   104     """
   104     """
   105     tos_link = redirects.getToSRedirect(site_logic.getSingleton())
   105     tos_link = redirects.getToSRedirect(site_logic.getSingleton())
   106 
   106 
   107     if not tos_link:
   107     if not tos_link: