0001-clear-all-session_var-if-new-ones-in-query-string-15.patch
tests/test_form_pages.py | ||
---|---|---|
1608 | 1608 |
resp = resp.click('test') |
1609 | 1609 |
assert resp.forms[0]['f0'].value == 'hello2' |
1610 | 1610 | |
1611 |
# check new session_var_ erase all previous ones |
|
1612 |
app = get_app(pub) |
|
1613 |
resp = app.get('/?session_var_foo=hello') |
|
1614 |
assert resp.location == 'http://example.net/' |
|
1615 |
resp = resp.follow() |
|
1616 |
resp = resp.click('test') |
|
1617 |
assert resp.forms[0]['f0'].value == 'hello' |
|
1618 |
resp = app.get('/?session_var_bar=hello') |
|
1619 |
assert resp.location == 'http://example.net/' |
|
1620 |
resp = resp.follow() |
|
1621 |
resp = resp.click('test') |
|
1622 |
assert resp.forms[0]['f0'].value == '' |
|
1623 | ||
1611 | 1624 |
# check repeated options are ignored |
1612 | 1625 |
resp = get_app(pub).get('/?session_var_foo=hello&session_var_foo=hello2') |
1613 | 1626 |
assert resp.location == 'http://example.net/' |
wcs/qommon/publisher.py | ||
---|---|---|
607 | 607 |
del request.form[k] |
608 | 608 |
if had_session_variables: |
609 | 609 |
self.start_request() # creates session |
610 |
request.session.add_extra_variables(**session_variables)
|
|
610 |
request.session.set_extra_variables(**session_variables)
|
|
611 | 611 |
self.finish_successful_request() # commits session |
612 | 612 |
new_query_string = '' |
613 | 613 |
if request.form: |
wcs/qommon/sessions.py | ||
---|---|---|
236 | 236 |
value.fp = open(filename) |
237 | 237 |
return value |
238 | 238 | |
239 |
def add_extra_variables(self, **kwargs): |
|
240 |
if not self.extra_variables: |
|
241 |
self.extra_variables = {} |
|
239 |
def set_extra_variables(self, **kwargs): |
|
240 |
self.extra_variables = {} |
|
242 | 241 |
self.extra_variables.update(kwargs) |
243 | 242 | |
244 | 243 |
def get_substitution_variables(self, prefix='session_var_'): |
245 |
- |