Clean up handling of translation syncing. (#2948)

* Clean up handling of translation syncing.

This makes sure we properly run all the post-save logic on the parent on translation,
also it adds a UI element to the page to show that subprojects are in fact, subprojects.

* Add comment
com-py3-compat
Eric Holscher 2017-06-15 15:07:34 -07:00 committed by Anthony
parent 636d62bf22
commit 951937c115
2 changed files with 5 additions and 0 deletions

View File

@ -494,6 +494,8 @@ class TranslationForm(forms.Form):
def save(self):
project = self.parent.translations.add(self.translation)
# Run symlinking and other sync logic to make sure we are in a good state.
self.parent.save()
return project

View File

@ -6,4 +6,7 @@
{% if request.user|is_project_user:project %}
<a href="{% url "projects_dashboard" %}">{% trans "Projects" %}</a>&nbsp;&gt;
{% endif %}
{% if project.superprojects.count %}
<a href="{% url "projects_detail" project.superprojects.all.0.parent.slug %}">{{ project.superprojects.all.0.parent.name }}</a>&nbsp;&gt;
{% endif %}
{% endblock %}