Ignore:
Timestamp:
25 Jun 2016, 05:00:54 (8 years ago)
Author:
Henrik Bettermann
Message:

Use url method properly.

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

Legend:

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

    r13989 r13990  
    4949
    5050    def render(self):
    51         self.flash(self.msg)
    52         self.redirect(self.url(self.context, self.redirect_path))
     51        if self.msg:
     52            self.flash(self.msg, type='warning')
     53        self.redirect(self.url(self.context) + self.redirect_path)
    5354        return
  • main/waeup.kofa/trunk/src/waeup/kofa/mandates/mandate.py

    r13989 r13990  
    7878            grok.getSite().logger.info(
    7979                'PasswordMandate used: %s ' % username)
    80             redirect_path = 'login'
     80            redirect_path = '/login'
    8181        del self.__parent__[self.mandate_id]
    8282        return msg, redirect_path
  • main/waeup.kofa/trunk/src/waeup/kofa/mandates/tests.py

    r13988 r13990  
    113113        self.assertEqual(msg,
    114114            'Password has been successfully set. Login with your new password.')
    115         self.assertEqual(redirect_path, 'login')
     115        self.assertEqual(redirect_path, '/login')
    116116        self.assertTrue(IUserAccount(student).checkPassword('mypwd1'))
    117117        # All mandates have been removed.
     
    133133        self.assertEqual(msg,
    134134            'Password has been successfully set. Login with your new password.')
    135         self.assertEqual(redirect_path, 'login')
     135        self.assertEqual(redirect_path, '/login')
    136136        self.assertTrue(IUserAccount(officer).checkPassword('mypwd1'))
    137137        logfile = os.path.join(
     
    151151        self.assertEqual(msg,
    152152            'Password has been successfully set. Login with your new password.')
    153         self.assertEqual(redirect_path, 'login')
     153        self.assertEqual(redirect_path, '/login')
    154154        self.assertTrue(IUserAccount(applicant).checkPassword('mypwd1'))
    155155        logfile = os.path.join(
     
    213213            % mandate.mandate_id)
    214214        self.assertTrue('No mandate' in self.browser.contents)
    215         self.assertEqual(self.browser.url, 'http://localhost/app/')
     215        self.assertEqual(self.browser.url, 'http://localhost/app')
    216216        # Mandate id is needed
    217217        self.browser.open('http://localhost/app/mandate')
    218218        self.assertTrue('Misuse' in self.browser.contents)
    219         self.assertEqual(self.browser.url, 'http://localhost/app/')
     219        self.assertEqual(self.browser.url, 'http://localhost/app')
    220220
    221221    def test_refereereport_mandate(self):
Note: See TracChangeset for help on using the changeset viewer.