Commit 60f18746 authored by Michal Čihař's avatar Michal Čihař

Unlock translations on logout

Fixes #983
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent b4e3c271
......@@ -27,7 +27,7 @@ from smtplib import SMTPException
from django.db import models
from django.dispatch import receiver
from django.conf import settings
from django.contrib.auth.signals import user_logged_in
from django.contrib.auth.signals import user_logged_in, user_logged_out
from django.db.models.signals import post_save, post_migrate
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible, force_text
......@@ -735,6 +735,13 @@ def post_login_handler(sender, request, user, **kwargs):
set_lang(request, profile)
@receiver(user_logged_out)
def post_logout_handler(sender, request, user, **kwargs):
# Unlock translations on logout
for translation in user.translation_set.all():
translation.create_lock(None)
def create_groups(update):
'''
Creates standard groups and gives them permissions.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment