mirror of
https://github.com/Hopiu/django-rosetta.git
synced 2026-03-17 05:40:26 +00:00
Merge branch 'pr/90' into develop
This commit is contained in:
commit
3061b8799f
4 changed files with 9 additions and 7 deletions
1
CHANGES
1
CHANGES
|
|
@ -5,6 +5,7 @@ Version 0.7.3
|
|||
* Missing context variable in catalog list (Issue #87 - Thanks @kunitoki)
|
||||
* Added support for Yandex translation API (Issue #89 - Thanks @BlackWizard) See supported languages and limitations here: https://github.com/mbi/django-rosetta/pull/89
|
||||
* Removed support for the signed_cookies SESSION_ENGINE + SessionRosettaStorage in Django 1.6, because serialization of POFiles would fail
|
||||
* Simplified the group membership test (Issue #90 - Thanks @dotsbb)
|
||||
|
||||
Version 0.7.2
|
||||
-------------
|
||||
|
|
|
|||
|
|
@ -28,9 +28,4 @@ def is_superuser_staff_or_in_translators_group(user):
|
|||
elif user.is_superuser and user.is_staff:
|
||||
return True
|
||||
else:
|
||||
try:
|
||||
from django.contrib.auth.models import Group
|
||||
translators = Group.objects.get(name='translators')
|
||||
return translators in user.groups.all()
|
||||
except Group.DoesNotExist:
|
||||
return False
|
||||
return user.groups.filter(name='translators').exists()
|
||||
|
|
|
|||
|
|
@ -60,3 +60,7 @@ STORAGE_CLASS = getattr(settings, 'ROSETTA_STORAGE_CLASS', 'rosetta.storage.Cach
|
|||
ROSETTA_CACHE_NAME = getattr(settings, 'ROSETTA_CACHE_NAME', 'default'
|
||||
if settings.CACHES.get('rosetta', None) is None
|
||||
else 'rosetta')
|
||||
|
||||
# Require users to be authenticated (and Superusers or in group "translators").
|
||||
# Set this to False at your own risk
|
||||
ROSETTA_REQUIRES_AUTH = getattr(settings, 'ROSETTA_REQUIRES_AUTH', True)
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ class RosettaTestCase(TestCase):
|
|||
|
||||
self.__session_engine = settings.SESSION_ENGINE
|
||||
self.__storage_class = rosetta_settings.STORAGE_CLASS
|
||||
self.__require_auth = rosetta_settings.ROSETTA_REQUIRES_AUTH
|
||||
|
||||
shutil.copy(self.dest_file, self.dest_file + '.orig')
|
||||
|
||||
|
|
@ -64,6 +65,7 @@ class RosettaTestCase(TestCase):
|
|||
settings.LANGUAGES = self.__old_settings_languages
|
||||
settings.SESSION_ENGINE = self.__session_engine
|
||||
rosetta_settings.STORAGE_CLASS = self.__storage_class
|
||||
rosetta_settings.ROSETTA_REQUIRES_AUTH = self.__require_auth
|
||||
shutil.move(self.dest_file + '.orig', self.dest_file)
|
||||
|
||||
def test_1_ListLoading(self):
|
||||
|
|
@ -581,7 +583,7 @@ class RosettaTestCase(TestCase):
|
|||
r = self.client.get(reverse('rosetta-pick-file'))
|
||||
self.assertTrue('<li class="active"><a href="?filter=third-party">' in str(r.content))
|
||||
|
||||
def test_1_unsupported_p3_django_16_storage(self):
|
||||
def test_29_unsupported_p3_django_16_storage(self):
|
||||
if self.django_version_minor >= 6 and self.django_version_major >= 1:
|
||||
self.assertTrue('django.contrib.sessions.middleware.SessionMiddleware' in settings.MIDDLEWARE_CLASSES)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue