Projet

Général

Profil

0001-theme-do-not-be-overly-confident-about-select-post-p.patch

Paul Marillonnet, 16 décembre 2021 20:34

Télécharger (1,27 ko)

Voir les différences:

Subject: [PATCH] theme: do not be overly confident about select post payload
 (#59815)

 hobo/theme/views.py | 2 +-
 tests/test_theme.py | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
hobo/theme/views.py
58 58
    permanent = False
59 59

  
60 60
    def get_redirect_url(self):
61
        if self.request.method == 'POST':
61
        if self.request.method == 'POST' and 'theme' in self.request.POST:
62 62
            set_theme(self.request.POST['theme'])
63 63
            messages.info(
64 64
                self.request, _('The theme has been changed, it will soon be visible on the sites.')
tests/test_theme.py
62 62
    app = login(app)
63 63
    resp = app.get('/theme/select')
64 64
    assert resp.location == '/theme/'
65
    resp = resp.follow()
66
    resp.form.submit()
65
-