Changeset 7409 for main/waeup.sirp/trunk


Ignore:
Timestamp:
20 Dec 2011, 11:53:30 (13 years ago)
Author:
Henrik Bettermann
Message:

Set password and print password on the application slip.

Alternatively, we can think about using the sendCredentials method and send mails with random passwords immediately after the student has been created.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/applicants
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicant.py

    r7406 r7409  
    3131from waeup.sirp.interfaces import (
    3232    IObjectHistory, IFileStoreHandler, IFileStoreNameChooser, ISIRPUtils,
    33     IExtFileStore, IPDF)
     33    IExtFileStore, IPDF, IUserAccount)
    3434from waeup.sirp.students.vocabularies import RegNumNotInSource
    3535from waeup.sirp.utils.helpers import attrs_to_fields, get_current_principal
     
    107107
    108108        # Set password
     109        IUserAccount(student).setPassword(self.application_number)
    109110
    110111        # Save the certificate
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/pdf.py

    r7398 r7409  
    180180        table = Table(data,style=SLIP_STYLE)
    181181        story.append(table)
     182
     183        # Add some comments
     184        if self.context.state == 'created':
     185            comment1 = (
     186                '<font size=10>Proceed to the login page of the portal' +
     187                ' and enter your new credentials:' +
     188                ' user name= %s, password = %s.</font>' %
     189                (self.context.student_id, self.context.application_number)
     190                )
     191            comment2 = (
     192                '<font size=10>Change your password when you have ' +
     193                ' logged in.</font>'
     194                )
     195            comment1 = Paragraph(comment1, style["Normal"])
     196            comment2 = Paragraph(comment2, style["Normal"])
     197            story.append(Spacer(1, 18))
     198            story.append(comment1)
     199            story.append(comment2)
     200
    182201        frame_body.addFromList(story,pdf)
    183202
Note: See TracChangeset for help on using the changeset viewer.