Project

General

Profile

0001-forms-remove-captcha-on-workflow-action-forms-13110.patch

Frédéric Péters, 08 September 2016 09:25 PM

Download (1.56 KB)

View differences:

Subject: [PATCH] forms: remove captcha on workflow action forms (#13110)

 tests/test_form_pages.py | 3 ---
 wcs/forms/common.py      | 4 ----
 2 files changed, 7 deletions(-)
tests/test_form_pages.py
929 929
    resp = resp.follow()
930 930
    assert 'form_comment' in resp.body # makes sure user is treated as submitter
931 931
    resp.forms[0]['comment'] = 'hello world'
932
    session_id = app.cookies.values()[0].strip('"')
933
    session = BasicSession.get(session_id)
934
    resp.forms[0]['captcha$q'] = session.get_captcha_token(resp.forms[0]['captcha$token'].value)['answer']
935 932
    resp = resp.forms[0].submit()
936 933
    assert formdef.data_class().get(formdata_id).evolution[-1].comment == 'hello world'
937 934

  
wcs/forms/common.py
232 232
        r += self.receipt()
233 233
        r += self.history()
234 234

  
235
        form = None
236

  
237 235
        session = get_session()
238 236
        user = get_request().user
239 237
        form = self.filled.get_workflow_form(user)
240
        if form:
241
            form.add_captcha()
242 238

  
243 239
        if form and form.is_submitted():
244 240
            if not form.has_errors():
245
-