mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-23 04:18:21 +00:00
Only show active user when share sth to others
This commit is contained in:
@@ -42,6 +42,7 @@ from seahub.utils import check_filename_with_rename, EMPTY_SHA1, \
|
||||
get_repo_last_modify, gen_file_upload_url, is_org_context, \
|
||||
get_org_user_events, get_user_events
|
||||
from seahub.utils.star import star_file, unstar_file
|
||||
from seahub.base.accounts import User
|
||||
|
||||
# Get an instance of a logger
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -1013,7 +1014,12 @@ def get_contacts(request):
|
||||
contact_list = []
|
||||
from seahub.avatar.templatetags.avatar_tags import avatar
|
||||
for c in contacts:
|
||||
try:
|
||||
user = User.objects.get(email = c.contact_email)
|
||||
if user.is_active:
|
||||
contact_list.append({"email": c.contact_email, "avatar": avatar(c.contact_email, 16)})
|
||||
except User.DoesNotExist:
|
||||
continue
|
||||
|
||||
return HttpResponse(json.dumps({"contacts":contact_list}), content_type=content_type)
|
||||
|
||||
|
Reference in New Issue
Block a user