Ticket #1475: sage-1475_1.patch

File sage-1475_1.patch, 2.0 kB (added by TimothyClemans, 4 months ago)
  • a/sage/server/notebook/twist.py

    old new  
    855855            notebook.user(self.username)['autosave_interval'] = int(request.args['autosave'][0]) * 60 
    856856            redirect_to_home = True 
    857857         
     858        if 'pretty_print' in request.args: 
     859            notebook.user(self.username)['default_pretty_print'] = bool(request.args['pretty_print'][0]) 
     860            redirect_to_home = True 
     861         
    858862        if 'Newpass' in request.args or 'RetypePass' in request.args: 
    859863            if not 'Oldpass' in request.args: 
    860864                error = 'Old password not given' 
     
    870874            if not error: #webbrowser may auto fill in "old password" even though the user may not want to change her password 
    871875                notebook.change_password(self.username, request.args['Newpass'][0]) 
    872876                redirect_to_logout = True 
     877                 
    873878        if notebook.conf()['email']: 
    874879            if 'Newemail' in request.args: 
    875880                notebook.user(self.username).set_email(request.args['Newemail'][0]) 
     
    885890            return http.RedirectResponse('/home/%s' % self.username) 
    886891         
    887892        template_dict = {} 
     893        template_dict['username'] = self.username 
    888894        template_dict['autosave_intervals'] = ((i, ' selected') if notebook.user(self.username)['autosave_interval']/60 == i else (i, '') for i in range(1, 10, 2)) 
     895        template_dict['pretty_print'] = notebook.user(self.username)['default_pretty_print'] 
    889896        template_dict['email'] = notebook.conf()['email'] 
    890897        if template_dict['email']: 
    891898            template_dict['email_address'] = 'None' if not notebook.user(self.username)._User__email else notebook.user(self.username)._User__email