# HG changeset patch # User Mads Kiilerich # Date 2013-04-04 13:55:53 # Node ID df57253e965af547d416414912e1394d77ed4f6c # Parent cf65b2c1b69d687ce08e45c7a2dbdaff5fae6de6 invalidation: simplify get_prefix str.split will always have a [0], and cache_key will always contain repo_name=cache_args and the split will thus always return two elements diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -1656,10 +1656,7 @@ class CacheInvalidation(Base, BaseModel) Guess prefix that might have been used in _get_cache_key to generate self.cache_key . Only used for informational purposes in repo_edit.html . """ - _split = self.cache_key.split(self.cache_args, 1) - if len(_split) == 2: - return _split[0] - return '' + return self.cache_key.split(self.cache_args, 1)[0] @classmethod def _get_cache_key(cls, key):