mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-23 04:18:21 +00:00
rm get_user_contacts
This commit is contained in:
@@ -1082,28 +1082,6 @@ def cancel_cp(request):
|
||||
content_type=content_type)
|
||||
|
||||
########## contacts related
|
||||
@login_required_ajax
|
||||
def get_contacts(request):
|
||||
content_type = 'application/json; charset=utf-8'
|
||||
|
||||
username = request.user.username
|
||||
contacts = Contact.objects.get_contacts_by_user(username)
|
||||
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, 32),
|
||||
"name": email2nickname(c.contact_email),
|
||||
})
|
||||
except User.DoesNotExist:
|
||||
continue
|
||||
|
||||
return HttpResponse(json.dumps({"contacts":contact_list}), content_type=content_type)
|
||||
|
||||
@login_required_ajax
|
||||
def get_current_commit(request, repo_id):
|
||||
content_type = 'application/json; charset=utf-8'
|
||||
|
Reference in New Issue
Block a user