diff --git a/CHANGELOG b/CHANGELOG index ac7cba775..46bea4a96 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -24,7 +24,9 @@ Version 1.7 (unreleased) Core: - New feature to tag motions, agenda and assignments. -Motion: +- Fixed search index problem to index contents of many-to-many table + (e.g. tags of a motion). +Motions: - New Feature to create amendments, which are related to a parent motion. - Added possibility to hide motions from non staff users in some states. Other: diff --git a/README.rst b/README.rst index 01f65eceb..4015e26d0 100644 --- a/README.rst +++ b/README.rst @@ -105,7 +105,7 @@ portable version you should observe the following install steps.* To install Virtual Python Environment builder, open command line (cmd) and run:: - > easy_install https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.11.6.tar.gz + > easy_install https://pypi.python.org/packages/source/v/virtualenv/virtualenv-12.0.5.tar.gz Create your OpenSlides directory, change to it, setup and activate the virtual environment:: diff --git a/extras/win32-portable/create_portable.txt b/extras/win32-portable/create_portable.txt index a6d2edbfd..a7138c19b 100644 --- a/extras/win32-portable/create_portable.txt +++ b/extras/win32-portable/create_portable.txt @@ -5,34 +5,21 @@ How to create a new portable Windows distribution of OpenSlides: Follow the instructions in the README, section III (Windows installation), step 1. -2. Install all required python packages (see requirements_production.txt): +2. Install all required python packages from requirements_production.txt: + (Note: You have to use 'easy_install -Z $PACKAGENAME') - easy_install -Z "django<1.7" ^ - backports.ssl_match_hostname ^ - "beautifulsoup4<4.4" ^ - "bleach<1.5" ^ - "django-ckeditor-updated<4.3" ^ - "django-haystack<2.2" ^ - "django-mptt<0.7" ^ - "jsonfield<0.10" ^ - "natsort<3.3" ^ - "reportlab<2.8" ^ - "roman<2.1" ^ - "sockjs_tornado<1.1" ^ - "tornado<3.3" ^ - "whoosh<2.6" ^ - "setuptools<3.7" + python install-requirements.py 3. Install pywin32 from binary installer: - http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/pywin32-218.win32-py2.7.exe/download + http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win32-py2.7.exe/download Pywin32 is used to update the version resource of the prebuild openslides.exe. It is not strictly required but at least for published releases it is highly advisable. 4. Install wxPython from binary installer: - http://downloads.sourceforge.net/wxpython/wxPython2.8-win32-unicode-2.8.12.1-py27.exe + http://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/wxPython2.8-win32-unicode-2.8.12.1-py27.exe/download WxPython is required to build the OpenSlides GUI frontend. diff --git a/extras/win32-portable/install-requirements.py b/extras/win32-portable/install-requirements.py new file mode 100644 index 000000000..c2dfaa3c2 --- /dev/null +++ b/extras/win32-portable/install-requirements.py @@ -0,0 +1,12 @@ +import os + +f = open("../../requirements_production.txt") +reqs = f.read().split("\n") + +for req in reqs: + # ignore comments or pip options + if req.startswith('--') or req.startswith('#'): + continue + # ignore blank lines + if len(req) > 0: + os.system('easy_install -Z -U "%s"' % req) diff --git a/openslides/agenda/templates/agenda/item_row.html b/openslides/agenda/templates/agenda/item_row.html index 89fc545a0..f6a39e51b 100644 --- a/openslides/agenda/templates/agenda/item_row.html +++ b/openslides/agenda/templates/agenda/item_row.html @@ -83,5 +83,8 @@ {% endwith %} {% if node.type == node.ORGANIZATIONAL_ITEM %}[{% endif %}{{ node }}{% if node.type == node.ORGANIZATIONAL_ITEM %}]{% endif %} {{ node.get_title_supplement|safe }} + {% for tag in node.tags.all %} + {{ tag }} + {% endfor %} diff --git a/openslides/agenda/templates/agenda/overview.html b/openslides/agenda/templates/agenda/overview.html index eaee7a1f2..19de2f53d 100644 --- a/openslides/agenda/templates/agenda/overview.html +++ b/openslides/agenda/templates/agenda/overview.html @@ -41,7 +41,7 @@ {% endif %} {% if perms.core.can_manage_tags %} - + {% trans 'Tags' %} {% endif %} diff --git a/openslides/agenda/templates/agenda/view.html b/openslides/agenda/templates/agenda/view.html index 0d6b1675f..800f17825 100644 --- a/openslides/agenda/templates/agenda/view.html +++ b/openslides/agenda/templates/agenda/view.html @@ -41,6 +41,13 @@ + + +{% for tag in item.tags.all %} + {{ tag }} +{% endfor %} + +

{% if not item.content_object %} {{ item.text|safe }} @@ -49,6 +56,7 @@ {% endif %}

+ {% if perms.agenda.can_manage_agenda %} {% if item.comment %}

{% trans "Comment" %}

@@ -56,7 +64,7 @@ {% endif %} {% endif %} -{# List of Speakers #} +

{% trans "List of speakers" %} {% if item.speaker_list_closed %}{% trans 'closed' %}{% endif %}

{% if perms.agenda.can_manage_agenda %} diff --git a/openslides/agenda/templates/search/indexes/agenda/item_text.txt b/openslides/agenda/templates/search/indexes/agenda/item_text.txt index 61e3e6538..b7c4eae96 100644 --- a/openslides/agenda/templates/search/indexes/agenda/item_text.txt +++ b/openslides/agenda/templates/search/indexes/agenda/item_text.txt @@ -1,2 +1,3 @@ {{ object.title }} {{ object.text }} +{{ object.tags.all }} diff --git a/openslides/assignment/templates/assignment/assignment_detail.html b/openslides/assignment/templates/assignment/assignment_detail.html index c84469848..313fd85e5 100644 --- a/openslides/assignment/templates/assignment/assignment_detail.html +++ b/openslides/assignment/templates/assignment/assignment_detail.html @@ -50,6 +50,11 @@ + +{% for tag in assignment.tags.all %} + {{ tag }} +{% endfor %} +

diff --git a/openslides/assignment/templates/assignment/assignment_list.html b/openslides/assignment/templates/assignment/assignment_list.html index 8af8c8977..da85429a7 100644 --- a/openslides/assignment/templates/assignment/assignment_list.html +++ b/openslides/assignment/templates/assignment/assignment_list.html @@ -23,7 +23,7 @@ {% endif %} {% if perms.core.can_manage_tags %} - + {% trans 'Tags' %} {% endif %} @@ -46,7 +46,11 @@ {% for object in object_list %} - {{ object }} + {{ object }} + {% for tag in object.tags.all %} + {{ tag }} + {% endfor %} + {% trans "Posts" context "Number of searched candidates for an election" %}: diff --git a/openslides/assignment/templates/search/indexes/assignment/assignment_text.txt b/openslides/assignment/templates/search/indexes/assignment/assignment_text.txt index 26c4bab18..3ea7b5085 100644 --- a/openslides/assignment/templates/search/indexes/assignment/assignment_text.txt +++ b/openslides/assignment/templates/search/indexes/assignment/assignment_text.txt @@ -1,3 +1,4 @@ {{ object.name }} {{ object.description }} {{ object.candidates }} +{{ object.tags.all }} diff --git a/openslides/core/chatbox.py b/openslides/core/chatbox.py index 0dd1e486c..ac6fb7df6 100644 --- a/openslides/core/chatbox.py +++ b/openslides/core/chatbox.py @@ -1,8 +1,9 @@ from datetime import datetime from django.conf import settings -from django.contrib.sessions.models import Session from django.utils.html import urlize +from django.utils.importlib import import_module + from sockjs.tornado import SockJSConnection @@ -18,22 +19,25 @@ class ChatboxSocketHandler(SockJSConnection): """ from openslides.users.models import User - # TODO: Use the django way to get the session to be compatible with - # other auth-backends; see comment in pull request #1220: - # https://github.com/OpenSlides/OpenSlides/pull/1220#discussion_r11565705 - session_key = info.get_cookie(settings.SESSION_COOKIE_NAME).value - session = Session.objects.get(session_key=session_key) + # get the session (compatible with other auth-backends) + engine = import_module(settings.SESSION_ENGINE) try: - self.user = User.objects.get(pk=session.get_decoded().get('_auth_user_id')) + session_key = info.get_cookie(settings.SESSION_COOKIE_NAME).value + session = engine.SessionStore(session_key) + pk = session.get_decoded().get('_auth_user_id') + except AttributeError: + return False + + try: + self.user = User.objects.get(pk) except User.DoesNotExist: - return_value = False + return False + + if self.user.has_perm('core.can_use_chat'): + self.clients.add(self) + return True else: - if self.user.has_perm('core.can_use_chat'): - self.clients.add(self) - return_value = True - else: - return_value = False - return return_value + return False def on_message(self, message): """ diff --git a/openslides/core/templates/base.html b/openslides/core/templates/base.html index 59ee0e770..028571d5e 100644 --- a/openslides/core/templates/base.html +++ b/openslides/core/templates/base.html @@ -113,7 +113,7 @@
@@ -134,7 +134,7 @@