mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 17:02:47 +00:00
Merge branch '1.1.0-fix'
This commit is contained in:
13
utils.py
13
utils.py
@@ -380,8 +380,17 @@ def get_file_contributors(repo_id, file_path, file_path_hash, file_id):
|
|||||||
last_modified = 0
|
last_modified = 0
|
||||||
last_commit_id = ''
|
last_commit_id = ''
|
||||||
try:
|
try:
|
||||||
fc = FileContributors.objects.get(repo_id=repo_id,
|
# HACK: Fixed the unique key bug in 1.1
|
||||||
file_path_hash=file_path_hash)
|
# Should be removed in future
|
||||||
|
fc = FileContributors.objects.filter(repo_id=repo_id,
|
||||||
|
file_path_hash=file_path_hash)
|
||||||
|
if not fc:
|
||||||
|
raise FileContributors.DoesNotExist
|
||||||
|
else:
|
||||||
|
if len(fc) > 1:
|
||||||
|
for e in fc[1:]:
|
||||||
|
e.delete()
|
||||||
|
fc = fc[0]
|
||||||
except FileContributors.DoesNotExist:
|
except FileContributors.DoesNotExist:
|
||||||
# has no cache yet
|
# has no cache yet
|
||||||
contributors, last_modified, last_commit_id = get_file_contributors_from_revisions (repo_id, file_path)
|
contributors, last_modified, last_commit_id = get_file_contributors_from_revisions (repo_id, file_path)
|
||||||
|
Reference in New Issue
Block a user