Commit 4d5b8e38 authored by Weblate's avatar Weblate

Merge remote-tracking branch 'origin/master'

parents 29865697 5cbe3e34
......@@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from django.db import models
from django.db import models, transaction
from django.utils.translation import ugettext as _, ugettext_lazy
from django.core.mail import mail_admins
from django.core.exceptions import ValidationError
......@@ -966,6 +966,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
matches = self.get_mask_matches()
language_re = re.compile(self.language_regex)
for pos, path in enumerate(matches):
with transaction.atomic():
code = self.get_lang_code(path)
if langs is not None and code not in langs:
self.log_info('skipping %s', path)
......@@ -995,6 +996,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
if langs is None:
todelete = self.translation_set.exclude(id__in=translations)
if todelete.exists():
with transaction.atomic():
self.log_info(
'removing stale translations: %s',
','.join([trans.language.code for trans in todelete])
......
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