mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 23:48:47 +00:00
Fixed autocomplete bug when share repo
This commit is contained in:
24
views.py
24
views.py
@@ -851,10 +851,6 @@ def myhome(request):
|
||||
# Personal repos others shared to me
|
||||
in_repos = list_personal_shared_repos(email,'to_email', -1, -1)
|
||||
|
||||
# Get registered contacts used in autocomplete.
|
||||
contacts = [ c for c in Contact.objects.filter(user_email=email) \
|
||||
if is_registered_user(c.contact_email) ]
|
||||
|
||||
# user notifications
|
||||
grpmsg_list = []
|
||||
grpmsg_reply_list = []
|
||||
@@ -871,7 +867,7 @@ def myhome(request):
|
||||
elif n.msg_type == 'org_join_msg':
|
||||
orgmsg_list.append(n.detail)
|
||||
|
||||
# Get all personal groups I joined used in autocomplete.
|
||||
# Get all personal groups I joined.
|
||||
joined_groups = get_personal_groups_by_user(request.user.username)
|
||||
|
||||
# get nickname
|
||||
@@ -886,6 +882,22 @@ def myhome(request):
|
||||
except:
|
||||
CLOUD_MODE = False
|
||||
|
||||
if CLOUD_MODE:
|
||||
# In cloud mode, list joined groups and registered contacts for
|
||||
# autocompletion.
|
||||
autocomp_groups = joined_groups
|
||||
contacts = [ c for c in Contact.objects.filter(user_email=email) \
|
||||
if is_registered_user(c.contact_email) ]
|
||||
else:
|
||||
# List all personal groups and all registered users for autocompletion.
|
||||
autocomp_groups = get_personal_groups(-1, -1)
|
||||
contacts = []
|
||||
for u in get_emailusers(-1, -1):
|
||||
if u.email == request.user.username:
|
||||
continue
|
||||
u.contact_email = u.email
|
||||
contacts.append(u)
|
||||
|
||||
allow_public_share = True if not CLOUD_MODE else False
|
||||
|
||||
# events
|
||||
@@ -908,8 +920,8 @@ def myhome(request):
|
||||
"quota_usage": quota_usage,
|
||||
"in_repos": in_repos,
|
||||
"contacts": contacts,
|
||||
"groups": joined_groups,
|
||||
"joined_groups": joined_groups,
|
||||
"autocomp_groups": autocomp_groups,
|
||||
"notes": notes,
|
||||
"grpmsg_list": grpmsg_list,
|
||||
"grpmsg_reply_list": grpmsg_reply_list,
|
||||
|
Reference in New Issue
Block a user