Ignore:
Timestamp:
27 Aug 2020, 06:24:17 (4 years ago)
Author:
Henrik Bettermann
Message:

Use email address as identifier for reports. Names can be changed by referees but email addresses must not be changed.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
3 edited

Legend:

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

    r16214 r16215  
    17961796            report_exists = False
    17971797            for report in self.context.refereereports:
    1798                 if report.name == referee.name:
     1798                if report.email == referee.email:
    17991799                    report_exists = True
    18001800            if report_exists:
     
    19201920            # (2) Report exists but was created with another mandate.
    19211921            for report in self.context.refereereports:
    1922                 if report.name == mandate.params.get('name'):
     1922                if report.email == mandate.params.get('email'):
    19231923                    self.flash(_('You have already created a '
    19241924                                 'report with another mandate.'),
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py

    r16190 r16215  
    685685    email = schema.ASCIILine(
    686686        title = _(u'Referee Email Address'),
    687         required = True,
    688         constraint=validate_email,
     687        #required = True,
     688        #constraint=validate_email,
     689        readonly = True,
    689690        )
    690691
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r16214 r16215  
    17401740            % mandate.mandate_id)
    17411741        self.assertTrue('Joan None' in self.browser.contents)
     1742        self.assertTrue('John Referee' in self.browser.contents)
    17421743        # Report can't be saved without required fields
    1743         self.browser.getControl(name="form.email").value = ''
     1744        self.browser.getControl(name="form.name").value = ''
    17441745        self.browser.getControl("Submit").click()
    17451746        self.assertTrue('Required input is missing' in self.browser.contents)
    1746         self.browser.getControl(name="form.email").value = 'bb@bb.bb'
     1747        self.browser.getControl(name="form.name").value = 'Johnny Referee'
    17471748        self.browser.getControl("Submit").click()
    17481749        # Referee will be redirected to the frontpage
     
    17891790        self.assertEqual(
    17901791            self.browser.url, self.view_path  + '/%s' % report.r_id)
    1791         self.assertTrue('John Referee' in self.browser.contents)
     1792        self.assertTrue('Johnny Referee' in self.browser.contents)
    17921793        # Managers can download a pdf slip
    17931794        self.browser.getLink("Download referee report").click()
     
    20312032        report = createObject(u'waeup.ApplicantRefereeReport')
    20322033        report.r_id = 'any_id'
    2033         report.name = u'Linda Tree'
     2034        report.name = u'Liiiinda Tree'
     2035        report.email = 'linda@forest.de'
    20342036        self.applicant[report.r_id] = report
    20352037        self.browser.open(self.manage_path)
Note: See TracChangeset for help on using the changeset viewer.