Hi Stephan,

I haven't seen an answer to you yet, so I'll give it a shot.

Am 11.05.10 14:04, schrieb Stephen Moretti:
> Given that the Agilo plugin is not enabled this should not be happening.
> I've checked on other environments and the same error occurs.  This
> seems to suggest that the Agilo install has altered something in Trac on
> a global basis. This should not have happened. 

Sadly this is a bug that we fixed about two weeks ago, which means that
it will be in the next release (due later this month).

The problem is that tracs extension mechanisms are not good enough for
what agilo wants to achieve, therefore agilo replaces some trac internal
models (milestones and tickets most notably) with it's own subclasses.

And in some rare cases agilo forgets to forward all responsibility to
the superclass if agilo is not enabled. :-/

> How do stop environments where Agilo is not enabled from attempting to
> use agilo ticket model?

You could give the attached patch a try and see if it works for you -
otherwise you could wait for the next release.

Sorry for the trouble!

Martin

-- 
--
Follow Agilo on Twitter: http://twitter.com/agiloforscrum
Please support us by reviewing and voting on: 
http://userstories.com/products/8-agilo-for-scrum 
http://ohloh.net/p/agilo-scrum 
http://freshmeat.net/projects/agiloforscrum

You received this message because you are subscribed to the Google
Groups "Agilo for Scrum" group. This group is moderated by agile42 GmbH 
http://www.agile42.com and is focused in supporting Agilo for Scrum users.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/agilo?hl=en
Index: agilo/ticket/tests/agilomilestone_test.py
===================================================================
--- agilo/ticket/tests/agilomilestone_test.py   (revision 2550)
+++ agilo/ticket/tests/agilomilestone_test.py   (revision 2551)
@@ -19,7 +19,7 @@
 
 from trac.ticket import Milestone
 
-from agilo.test import AgiloTestCase
+from agilo.test import AgiloTestCase, TestEnvHelper
 from agilo.ticket.model import AgiloMilestone
 from agilo.scrum.sprint.model import SprintModelManager
 from agilo.utils import Key, Type
@@ -78,3 +78,15 @@
         s = smm.get(name=s.name)
         self.assert_equals(m.name, s.milestone)
 
+    def test_do_not_raise_exception_on_edit_in_multienv_with_plain_trac(self):
+        plain_trac_env = TestEnvHelper(enable_agilo=False).env
+        # This situation happens due to monkey-patching: The plain trac 
+        # environment needs to work with Agilo classes.
+        milestone = AgiloMilestone(plain_trac_env)
+        milestone.name = 'fnord'
+        milestone.insert()
+        
+        # Must not raise an exception
+        milestone.update()
+
+
Index: agilo/ticket/model.py
===================================================================
--- agilo/ticket/model.py       (revision 2550)
+++ agilo/ticket/model.py       (revision 2551)
@@ -1255,7 +1255,10 @@
     """Wraps the Trac Milestone to add the update behaviour for the Sprints, on
     top of the tickets"""
     
+    # OVERRIDE
     def update(self, db=None):
+        if not AgiloConfig(self.env).is_agilo_enabled:
+            return super(AgiloMilestone, self).update(db=db)
         assert self.name, 'Cannot update milestone with no name'
         if not db:
             db = self.env.get_db_cnx()

Reply via email to