1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-10 03:11:07 +00:00

Fixed rpc return value bug

This commit is contained in:
zhengxie
2013-02-28 19:58:02 +08:00
parent cd1408fb6b
commit f108c3b79a
2 changed files with 6 additions and 5 deletions

View File

@@ -157,8 +157,8 @@ def count_emailusers():
try: try:
ret = ccnet_threaded_rpc.count_emailusers() ret = ccnet_threaded_rpc.count_emailusers()
except SearpcError: except SearpcError:
ret = 0 ret = -1
return ret return 0 if ret < 0 else ret
def get_session_info(): def get_session_info():
return ccnet_rpc.get_session_info() return ccnet_rpc.get_session_info()
@@ -666,8 +666,8 @@ def count_inner_pub_repos():
try: try:
ret = seafserv_threaded_rpc.count_inner_pub_repos() ret = seafserv_threaded_rpc.count_inner_pub_repos()
except SearpcError: except SearpcError:
ret = 0 ret = -1
return ret return 0 if ret < 0 else ret
def is_inner_pub_repo(repo_id): def is_inner_pub_repo(repo_id):
""" """

View File

@@ -894,7 +894,8 @@ def repo_history_changes(request, repo_id):
changes['cmt_desc'] = repo.desc changes['cmt_desc'] = repo.desc
elif c.second_parent_id is None: elif c.second_parent_id is None:
# Normal commit only has one parent. # Normal commit only has one parent.
changes['cmt_desc'] = c.desc if c.desc.startswith('Changed library'):
changes['cmt_desc'] = _('Changed library name or description')
else: else:
# A commit is a merge only if it has two parents. # A commit is a merge only if it has two parents.
changes['cmt_desc'] = _('No conflict in the merge.') changes['cmt_desc'] = _('No conflict in the merge.')