[damned-lies] Refs #268 - Allow po submission as soon as file is translated



commit 91df9a01f937f3fd8805612b110f6c6a7c674943
Author: Claude Paroz <claude 2xlibre net>
Date:   Thu Nov 11 17:39:42 2021 +0100

    Refs #268 - Allow po submission as soon as file is translated

 vertimus/models.py      | 2 ++
 vertimus/tests/tests.py | 8 ++++++++
 2 files changed, 10 insertions(+)
---
diff --git a/vertimus/models.py b/vertimus/models.py
index 1681aa5a..fbd4b03a 100644
--- a/vertimus/models.py
+++ b/vertimus/models.py
@@ -188,6 +188,8 @@ class StateTranslated(State):
 
         if person.is_committer(self.language.team):
             action_names.append('TC')
+            if self.able_to_commit():
+                action_names.append('CI')
 
         return self._get_available_actions(person, action_names)
 
diff --git a/vertimus/tests/tests.py b/vertimus/tests/tests.py
index bb250791..74c4ec43 100644
--- a/vertimus/tests/tests.py
+++ b/vertimus/tests/tests.py
@@ -327,6 +327,14 @@ class VertimusTest(TeamsAndRolesMixin, TestCase):
         role = Role.objects.get(person=self.pt, team=self.language.team)
         self.assertTrue(role.is_active)
 
+        # Setup as a writable repo and test Submit to repository is already available
+        self.b.module.vcs_root = 'git gitlab gnome org:GNOME/%s.git' % self.b.module.name
+        self.b.module.save()
+        self.assertEqual(
+            [act.name for act in state.get_available_actions(self.pcoo)],
+            ['RP', 'UP', 'TR', 'RT', 'TC', 'CI', 'WC', None, 'IC', 'AA']
+        )
+
     @test_scratchdir
     def test_action_ut_already_reserved(self):
         """


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]