Mercurial > kallithea
changeset 8793:b1fb9927ca47
indexer: drop "akc" cleanup
It was introduced in 0eceb478c720 but it is unclear what it does. We would
rather understand and fix any js encoding errors.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Thu, 12 Nov 2020 18:52:11 +0100 |
parents | 911669ac48a5 |
children | 7c541dc095c8 |
files | kallithea/model/async_tasks.py |
diffstat | 1 files changed, 7 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/model/async_tasks.py Thu Nov 12 18:56:53 2020 +0100 +++ b/kallithea/model/async_tasks.py Thu Nov 12 18:52:11 2020 +0100 @@ -66,11 +66,6 @@ .run(full_index=full_index) -# for js data compatibility cleans the key for person from ' -def akc(k): - return h.person(k).replace('"', '') - - @celerylib.task @celerylib.dbsession def get_commits_stats(repo_name, ts_min_y, ts_max_y, recurse_limit=100): @@ -135,17 +130,18 @@ tt = cs.date.timetuple() k = mktime(tt[:3] + (0, 0, 0, 0, 0, 0)) - if akc(cs.author) in co_day_auth_aggr: + username = h.person(cs.author) + if username in co_day_auth_aggr: try: l = [timegetter(x) for x in - co_day_auth_aggr[akc(cs.author)]['data']] + co_day_auth_aggr[username]['data']] time_pos = l.index(k) except ValueError: time_pos = None if time_pos is not None and time_pos >= 0: datadict = \ - co_day_auth_aggr[akc(cs.author)]['data'][time_pos] + co_day_auth_aggr[username]['data'][time_pos] datadict["commits"] += 1 datadict["added"] += len(cs.added) @@ -161,13 +157,13 @@ "changed": len(cs.changed), "removed": len(cs.removed), } - co_day_auth_aggr[akc(cs.author)]['data'] \ + co_day_auth_aggr[username]['data'] \ .append(datadict) else: if k >= ts_min_y and k <= ts_max_y or skip_date_limit: - co_day_auth_aggr[akc(cs.author)] = { - "label": akc(cs.author), + co_day_auth_aggr[username] = { + "label": username, "data": [{"time": k, "commits": 1, "added": len(cs.added),