def store_config_value(key, value): try: setting = ConfigSetting.objects.get(key=key) except ObjectDoesNotExist: setting = ConfigSetting() setting.key = key setting.value = value setting.save() refresh()
# but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with StratoSource. If not, see <http://www.gnu.org/licenses/>. # from stratosource.admin.models import ConfigSetting from django.core.exceptions import ObjectDoesNotExist STANDARDCHKSETTINGS='rally.enabled' STANDARDTXTSETTINGS='rally.login,email.host,email.from' STANDARDPASSWORDS='rally.password' for name in STANDARDTXTSETTINGS.split(','): s = ConfigSetting(key=name, value='', allow_delete=False, masked=False) s.save() for name in STANDARDCHKSETTINGS.split(','): s = ConfigSetting(key=name, value='', type='check', allow_delete=False, masked=False) s.save() for name in STANDARDPASSWORDS.split(','): s = ConfigSetting(key=name, value='', allow_delete=False, masked=True) s.save() #try: # unReleased = Release.objects.get(name='Unreleased') # unReleased.name = 'Unreleased' # unReleased.hidden = True # unReleased.isdefault = True
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with StratoSource. If not, see <http://www.gnu.org/licenses/>. # from stratosource.admin.models import ConfigSetting from django.core.exceptions import ObjectDoesNotExist import uuid STANDARDCHKSETTINGS = 'rally.enabled,agilezen.enabled' STANDARDTXTSETTINGS = 'rally.login,email.host,email.from' STANDARDPASSWORDS = 'rally.password,agilezen.apikey' s = ConfigSetting(key='calendar.host', value='localhost', allow_delete=False, masked=False) s.save() s = ConfigSetting(key='uuid', value=uuid.uuid1(), allow_delete=False, masked=False) s.save() for name in STANDARDTXTSETTINGS.split(','): s = ConfigSetting(key=name, value='', allow_delete=False, masked=False) s.save() for name in STANDARDCHKSETTINGS.split(','): s = ConfigSetting(key=name, value='',
# but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with StratoSource. If not, see <http://www.gnu.org/licenses/>. # from stratosource.admin.models import ConfigSetting from django.core.exceptions import ObjectDoesNotExist STANDARDCHKSETTINGS = 'rally.enabled' STANDARDTXTSETTINGS = 'rally.login,email.host,email.from' STANDARDPASSWORDS = 'rally.password' for name in STANDARDTXTSETTINGS.split(','): s = ConfigSetting(key=name, value='', allow_delete=False, masked=False) s.save() for name in STANDARDCHKSETTINGS.split(','): s = ConfigSetting(key=name, value='', type='check', allow_delete=False, masked=False) s.save() for name in STANDARDPASSWORDS.split(','): s = ConfigSetting(key=name, value='', allow_delete=False, masked=True) s.save() #try: