[web/request] Restore attribute setting for search_state

This was dropped in 1f84295bfe95 when search_state attribute was turned into a property, but without a setter. So adding a setter here restoring previous behaviour, as some tests and cubes use it.

Related to #4875761.

authorDenis Laxalde <denis.laxalde@logilab.fr>
changesetffb269e60348
branchdefault
phasepublic
hiddenno
parent revision#d6131c5045be [web/request] simplify search_state loading, fix comment
child revision#0f45b8160fd3 [hooks/integrity] kill CheckUniqueHook, #4b32613c4bc9 [devtools/testlib] Turn assertions about direct usage of CubicWebTC/AutomaticWebTest into warnings, #6dcde89d5192 [web] kill https-deny-anonymous option (closes #5193687), #30a233f3ebe0 [web/test] Drop folder cube dependency, #729f36a1bcfa merge 3.20.6 into 3.21, #22447b845d74 [web] kill https-deny-anonymous option (closes #5193687)
files modified by this revision
web/request.py
# HG changeset patch
# User Denis Laxalde <denis.laxalde@logilab.fr>
# Date 1427274624 -3600
# Wed Mar 25 10:10:24 2015 +0100
# Node ID ffb269e603484994cf79843734379cdfdee91c43
# Parent d6131c5045bee7fcd5529ba282ffb5f97768ae3a
[web/request] Restore attribute setting for search_state

This was dropped in 1f84295bfe95 when `search_state` attribute was turned into
a property, but without a setter. So adding a setter here restoring previous
behaviour, as some tests and cubes use it.

Related to #4875761.

diff --git a/web/request.py b/web/request.py
@@ -366,10 +366,14 @@
1          if self._search_state is None:
2              searchstate = self.session.data.get('search_state', 'normal')
3              self._load_search_state(searchstate)
4          return self._search_state
5 
6 +    @search_state.setter
7 +    def search_state(self, searchstate):
8 +        self._search_state = searchstate
9 +
10      def update_search_state(self):
11          """update the current search state if needed"""
12          searchstate = self.form.get('__mode')
13          if searchstate:
14              self.set_search_state(searchstate)