Show More
@@ -165,7 +165,7 b' class RhodeCodeSetting(Base, BaseModel):' | |||
|
165 | 165 | @hybrid_property |
|
166 | 166 | def app_settings_value(self): |
|
167 | 167 | v = self._app_settings_value |
|
168 |
if |
|
|
168 | if self.app_settings_name == 'ldap_active': | |
|
169 | 169 | v = str2bool(v) |
|
170 | 170 | return v |
|
171 | 171 | |
@@ -446,6 +446,7 b' class UsersGroupMember(Base, BaseModel):' | |||
|
446 | 446 | self.users_group_id = gr_id |
|
447 | 447 | self.user_id = u_id |
|
448 | 448 | |
|
449 | ||
|
449 | 450 | class Repository(Base, BaseModel): |
|
450 | 451 | __tablename__ = 'repositories' |
|
451 | 452 | __table_args__ = ( |
@@ -1027,6 +1028,19 b' class CacheInvalidation(Base, BaseModel)' | |||
|
1027 | 1028 | self.cache_id, self.cache_key) |
|
1028 | 1029 | |
|
1029 | 1030 | @classmethod |
|
1031 | def _get_key(cls, key): | |
|
1032 | """ | |
|
1033 | Wrapper for generating a key | |
|
1034 | ||
|
1035 | :param key: | |
|
1036 | """ | |
|
1037 | return "%s" % (key) | |
|
1038 | ||
|
1039 | @classmethod | |
|
1040 | def get_by_key(cls, key): | |
|
1041 | return cls.query().filter(cls.cache_key == key).scalar() | |
|
1042 | ||
|
1043 | @classmethod | |
|
1030 | 1044 | def invalidate(cls, key): |
|
1031 | 1045 | """ |
|
1032 | 1046 | Returns Invalidation object if this given key should be invalidated |
@@ -1071,8 +1085,7 b' class CacheInvalidation(Base, BaseModel)' | |||
|
1071 | 1085 | |
|
1072 | 1086 | :param key: |
|
1073 | 1087 | """ |
|
1074 |
inv_obj = |
|
|
1075 | .filter(CacheInvalidation.cache_key == key).scalar() | |
|
1088 | inv_obj = cls.get_by_key(key) | |
|
1076 | 1089 | inv_obj.cache_active = True |
|
1077 | 1090 | Session.add(inv_obj) |
|
1078 | 1091 | Session.commit() |
General Comments 0
You need to be logged in to leave comments.
Login now