Changeset - 7b0f803229be
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2012-09-17 21:26:32
marcin@python-works.com
autofix largefiles hggit hgsubversion options if they are not in the database
1 file changed with 17 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/admin/settings.py
Show inline comments
 
@@ -247,32 +247,49 @@ class SettingsController(BaseController)
 
                sett.ui_active = form_result[_f('hooks_%s' %
 
                                                RhodeCodeUi.HOOK_PUSH)]
 
                Session().add(sett)
 

	
 
                sett = RhodeCodeUi.get_by_key(RhodeCodeUi.HOOK_PULL)
 
                sett.ui_active = form_result[_f('hooks_%s' %
 
                                                 RhodeCodeUi.HOOK_PULL)]
 

	
 
                Session().add(sett)
 

	
 
                ## EXTENSIONS
 
                sett = RhodeCodeUi.get_by_key('largefiles')
 
                if not sett:
 
                    #make one if it's not there !
 
                    sett = RhodeCodeUi()
 
                    sett.ui_key = 'largefiles'
 
                    sett.ui_section = 'extensions'
 
                sett.ui_active = form_result[_f('extensions_largefiles')]
 
                Session().add(sett)
 

	
 
                sett = RhodeCodeUi.get_by_key('hgsubversion')
 
                if not sett:
 
                    #make one if it's not there !
 
                    sett = RhodeCodeUi()
 
                    sett.ui_key = 'hgsubversion'
 
                    sett.ui_section = 'extensions'
 

	
 
                sett.ui_active = form_result[_f('extensions_hgsubversion')]
 
                Session().add(sett)
 

	
 
#                sett = RhodeCodeUi.get_by_key('hggit')
 
#                if not sett:
 
#                    #make one if it's not there !
 
#                    sett = RhodeCodeUi()
 
#                    sett.ui_key = 'hggit'
 
#                    sett.ui_section = 'extensions'
 
#
 
#                sett.ui_active = form_result[_f('extensions_hggit')]
 
#                Session().add(sett)
 

	
 
                Session().commit()
 

	
 
                h.flash(_('Updated VCS settings'), category='success')
 

	
 
            except Exception:
 
                log.error(traceback.format_exc())
 
                h.flash(_('error occurred during updating '
 
                          'application settings'), category='error')
 

	
0 comments (0 inline, 0 general)