Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Dropped use of extra function to call signal on Lotte

  • Loading branch information...
commit cdbda6ac6ead503be7f0d855b61058d9b59a7f4c 1 parent 0b04b07
@diegobz diegobz authored Apostolos Bessas committed
Showing with 11 additions and 9 deletions.
  1. +11 −9 transifex/addons/lotte/views.py
View
20 transifex/addons/lotte/views.py
@@ -933,7 +933,11 @@ def _save_translation(source_string, translations, target_language, user):
translation_string.user = user
translation_string.save()
- _add_copyright(source_string, target_language, user)
+ # Raising translation saved signal
+ lotte_save_translation.send(None, resource=resource,
+ source_string=source_string, language=target_language,
+ user=user)
+
invalidate_stats_cache(resource, target_language, user=user)
except Translation.DoesNotExist:
# Only create new if the translation string sent, is not empty!
@@ -943,7 +947,12 @@ def _save_translation(source_string, translations, target_language, user):
language=target_language, rule=rule, string=target_string,
resource=resource
)
- _add_copyright(source_string, target_language, user)
+
+ # Raising translation saved signal
+ lotte_save_translation.send(None, resource=resource,
+ source_string=source_string, language=target_language,
+ user=user)
+
invalidate_stats_cache(resource, target_language, user=user)
else:
# In cases of pluralized translations, sometimes only one
@@ -967,13 +976,6 @@ def _save_translation(source_string, translations, target_language, user):
return warnings
-def _add_copyright(source_string, target_language, user):
- lotte_save_translation.send(
- None, resource=source_string.resource, source_string=source_string,
- language=target_language, user=user
- )
-
-
# Restrict access only for private projects since this is used to fetch stuff
# Allow even anonymous access on public projects
def tab_details_snippet(request, entity_id, lang_code):
Please sign in to comment.
Something went wrong with that request. Please try again.