##// END OF EJS Templates
simplified boolean expressions
marcink -
r3888:7aa0ff5b beta
parent child Browse files
Show More
@@ -35,7 +35,7 b' class CeleryCommand(BasePasterCommand):'
35 except KeyError:
35 except KeyError:
36 CELERY_ON = False
36 CELERY_ON = False
37
37
38 if CELERY_ON == False:
38 if not CELERY_ON:
39 raise Exception('Please enable celery_on in .ini config '
39 raise Exception('Please enable celery_on in .ini config '
40 'file before running celeryd')
40 'file before running celeryd')
41 rhodecode.CELERY_ON = CELERY_ON
41 rhodecode.CELERY_ON = CELERY_ON
@@ -90,7 +90,7 b' class Collection(pathed.Pathed):'
90 return max([VerNum(0)] + self.versions.keys())
90 return max([VerNum(0)] + self.versions.keys())
91
91
92 def _next_ver_num(self, use_timestamp_numbering):
92 def _next_ver_num(self, use_timestamp_numbering):
93 if use_timestamp_numbering == True:
93 if use_timestamp_numbering:
94 return VerNum(int(datetime.utcnow().strftime('%Y%m%d%H%M%S')))
94 return VerNum(int(datetime.utcnow().strftime('%Y%m%d%H%M%S')))
95 else:
95 else:
96 return self.latest + 1
96 return self.latest + 1
@@ -555,7 +555,7 b' def load_rcextensions(root_path):'
555
555
556 #OVERRIDE OUR EXTENSIONS FROM RC-EXTENSIONS (if present)
556 #OVERRIDE OUR EXTENSIONS FROM RC-EXTENSIONS (if present)
557
557
558 if getattr(EXT, 'INDEX_EXTENSIONS', []) != []:
558 if getattr(EXT, 'INDEX_EXTENSIONS', []):
559 log.debug('settings custom INDEX_EXTENSIONS')
559 log.debug('settings custom INDEX_EXTENSIONS')
560 conf.INDEX_EXTENSIONS = getattr(EXT, 'INDEX_EXTENSIONS', [])
560 conf.INDEX_EXTENSIONS = getattr(EXT, 'INDEX_EXTENSIONS', [])
561
561
@@ -123,7 +123,7 b' class PermissionModel(BaseModel):'
123 self.sa.add(p)
123 self.sa.add(p)
124
124
125 #stage 3 update all default permissions for repos if checked
125 #stage 3 update all default permissions for repos if checked
126 if form_result['overwrite_default_repo'] == True:
126 if form_result['overwrite_default_repo']:
127 _def_name = form_result['default_repo_perm'].split('repository.')[-1]
127 _def_name = form_result['default_repo_perm'].split('repository.')[-1]
128 _def = Permission.get_by_key('repository.' + _def_name)
128 _def = Permission.get_by_key('repository.' + _def_name)
129 # repos
129 # repos
@@ -136,7 +136,7 b' class PermissionModel(BaseModel):'
136 r2p.permission = _def
136 r2p.permission = _def
137 self.sa.add(r2p)
137 self.sa.add(r2p)
138
138
139 if form_result['overwrite_default_group'] == True:
139 if form_result['overwrite_default_group']:
140 _def_name = form_result['default_group_perm'].split('group.')[-1]
140 _def_name = form_result['default_group_perm'].split('group.')[-1]
141 # groups
141 # groups
142 _def = Permission.get_by_key('group.' + _def_name)
142 _def = Permission.get_by_key('group.' + _def_name)
@@ -146,7 +146,7 b' class PermissionModel(BaseModel):'
146 g2p.permission = _def
146 g2p.permission = _def
147 self.sa.add(g2p)
147 self.sa.add(g2p)
148
148
149 if form_result['overwrite_default_user_group'] == True:
149 if form_result['overwrite_default_user_group']:
150 _def_name = form_result['default_user_group_perm'].split('usergroup.')[-1]
150 _def_name = form_result['default_user_group_perm'].split('usergroup.')[-1]
151 # groups
151 # groups
152 _def = Permission.get_by_key('usergroup.' + _def_name)
152 _def = Permission.get_by_key('usergroup.' + _def_name)
General Comments 0
You need to be logged in to leave comments. Login now