Ignore:
Timestamp:
5 Nov 2012, 18:39:56 (12 years ago)
Author:
Henrik Bettermann
Message:

Check expiration of personal data when logging in students.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py

    r9495 r9545  
    214214                self.flash(_('You logged in.'))
    215215                if self.request.principal.user_type == 'student':
     216                    student = grok.getSite()['students'][
     217                        self.request.principal.id]
    216218                    rel_link = '/students/%s' % self.request.principal.id
     219                    if student.personal_data_expired:
     220                        rel_link = '/students/%s/edit_personal' % (
     221                            self.request.principal.id)
     222                        self.flash(
     223                          _('Your personal data record expired. '
     224                            'Please update.'))
    217225                    self.redirect(self.application_url() + rel_link)
    218226                    return
  • main/waeup.kofa/trunk/src/waeup/kofa/students/student.py

    r9521 r9545  
    202202        return False
    203203
     204    @property
     205    def personal_data_expired(self):
     206        now = datetime.utcnow()
     207        if self.personal_updated:
     208            days_ago = getattr(
     209                now - self.personal_updated, 'days')
     210            if days_ago > 180:
     211                return True
     212        return False
     213
    204214    def transfer(self, certificate, current_session=None,
    205215        current_level=None, current_verdict=None, previous_verdict=None):
Note: See TracChangeset for help on using the changeset viewer.