[ticket-workflow] is restored to default on environment upgrade
|Reported by:||Ryan J Ollos||Owned by:||Ryan J Ollos|
Fixed regression in r14888.
I noticed that when upgrading the environment the following message always appears:
==== Upgrade Notice ==== The ticket Workflow is now configurable. Your environment has been upgraded, but configured to use the original workflow. It is recommended that you look at changing this configuration to use basic-workflow.
On upgrading from Trac 1.0.x to the trunk, the
[ticket-workflow] section is overwritten.
The problem is that every upgrade participant is executed when upgrading the environment, therefore trac.ticket.default_workflow.ConfigurableTicketWorkflow.upgrade_environment is always executed. The following change would fix the issue:
diff --git a/trac/env.py b/trac/env.py index fce6b01..8e95b07 100644
a b class Environment(Component, ComponentManager): 731 731 raise BackupError(e) 732 732 733 733 for participant in self.setup_participants: 734 self.log.info("%s.%s upgrading...", participant.__module__, 735 participant.__class__.__name__) 736 participant.upgrade_environment() 737 # Database schema may have changed, so close all connections 738 DatabaseManager(self).shutdown() 734 if participant.environment_needs_upgrade(): 735 self.log.info("%s.%s upgrading...", participant.__module__, 736 participant.__class__.__name__) 737 participant.upgrade_environment() 738 # Database schema may have changed, so close all connections. 739 DatabaseManager(self).shutdown() 739 740 del self.database_version 740 741 return True