diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2015-05-14 14:40:10 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-05-29 11:59:43 +0100 |
commit | a5236be47fd62d41eaea2d4b4f1a394de0aac4a9 (patch) | |
tree | ed78623e18ee07ccd270bda36e51e598b9707469 | |
parent | 5da543c7b5cd565eed285a5015b1cafdc71ddb83 (diff) | |
download | poky-a5236be47fd62d41eaea2d4b4f1a394de0aac4a9.tar.gz |
bitbake: toaster: enable server-side sessions for all usages
In an effort to fix client-side session storage using
cookies, we enable server-side session support for all pages.
(Bitbake rev: ba10b6f89767c0dad8a2b064f42a84956764e9da)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | bitbake/bin/toaster | 6 | ||||
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 6 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastermain/settings.py | 17 |
3 files changed, 15 insertions, 14 deletions
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster index 18eba8ea07..93abcfad3b 100755 --- a/bitbake/bin/toaster +++ b/bitbake/bin/toaster | |||
@@ -53,7 +53,11 @@ function webserverStartAll() | |||
53 | fi | 53 | fi |
54 | 54 | ||
55 | retval=0 | 55 | retval=0 |
56 | python $BBBASEDIR/lib/toaster/manage.py syncdb || retval=1 | 56 | if [ "$TOASTER_MANAGED" '==' '1' ]; then |
57 | python $BBBASEDIR/lib/toaster/manage.py syncdb || retval=1 | ||
58 | else | ||
59 | python $BBBASEDIR/lib/toaster/manage.py syncdb --noinput || retval=1 | ||
60 | fi | ||
57 | python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=2 | 61 | python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=2 |
58 | if [ $retval -eq 1 ]; then | 62 | if [ $retval -eq 1 ]; then |
59 | echo "Failed db sync, stopping system start" 1>&2 | 63 | echo "Failed db sync, stopping system start" 1>&2 |
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 9217d8a100..c16fc2219f 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -266,8 +266,10 @@ def _get_queryset(model, queryset, filter_string, search_term, ordering_string, | |||
266 | # if the value is given explicitly as a GET parameter it will be the first selected, | 266 | # if the value is given explicitly as a GET parameter it will be the first selected, |
267 | # otherwise the cookie value will be used. | 267 | # otherwise the cookie value will be used. |
268 | def _get_parameters_values(request, default_count, default_order): | 268 | def _get_parameters_values(request, default_count, default_order): |
269 | pagesize = request.GET.get('count', request.COOKIES.get('count', default_count)) | 269 | from django.core.urlresolvers import resolve |
270 | orderby = request.GET.get('orderby', request.COOKIES.get('orderby', default_order)) | 270 | current_url = resolve(request.path_info).url_name |
271 | pagesize = request.GET.get('count', request.session.get('%s_count' % current_url, default_count)) | ||
272 | orderby = request.GET.get('orderby', request.session.get('%s_orderby' % current_url, default_order)) | ||
271 | return (pagesize, orderby) | 273 | return (pagesize, orderby) |
272 | 274 | ||
273 | 275 | ||
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index 80f26e0ce6..225138b32d 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py | |||
@@ -258,8 +258,13 @@ TEMPLATE_CONTEXT_PROCESSORS = ('django.contrib.auth.context_processors.auth', | |||
258 | ) | 258 | ) |
259 | 259 | ||
260 | INSTALLED_APPS = ( | 260 | INSTALLED_APPS = ( |
261 | #'django.contrib.sites', | 261 | 'django.contrib.auth', |
262 | 'django.contrib.contenttypes', | ||
263 | 'django.contrib.messages', | ||
264 | 'django.contrib.sessions', | ||
265 | 'django.contrib.admin', | ||
262 | 'django.contrib.staticfiles', | 266 | 'django.contrib.staticfiles', |
267 | |||
263 | # Uncomment the next line to enable admin documentation: | 268 | # Uncomment the next line to enable admin documentation: |
264 | # 'django.contrib.admindocs', | 269 | # 'django.contrib.admindocs', |
265 | 'django.contrib.humanize', | 270 | 'django.contrib.humanize', |
@@ -307,16 +312,6 @@ if os.environ.get('TOASTER_DEVEL', None) is not None: | |||
307 | 312 | ||
308 | SOUTH_TESTS_MIGRATE = False | 313 | SOUTH_TESTS_MIGRATE = False |
309 | 314 | ||
310 | # if we run in managed mode, we need user support | ||
311 | if MANAGED: | ||
312 | INSTALLED_APPS = ('django.contrib.auth', | ||
313 | 'django.contrib.contenttypes', | ||
314 | 'django.contrib.messages', | ||
315 | 'django.contrib.sessions', | ||
316 | # Uncomment the next line to enable the admin: | ||
317 | 'django.contrib.admin', | ||
318 | ) + INSTALLED_APPS | ||
319 | |||
320 | 315 | ||
321 | # We automatically detect and install applications here if | 316 | # We automatically detect and install applications here if |
322 | # they have a 'models.py' or 'views.py' file | 317 | # they have a 'models.py' or 'views.py' file |