1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 15:09:14 +00:00

show 'profile' in home;add profile-modify in setting

This commit is contained in:
llj
2012-06-20 14:18:23 +08:00
parent bd54b31a0a
commit 473cf33b97
8 changed files with 106 additions and 17 deletions

View File

@@ -29,6 +29,7 @@ from seahub.contacts.models import Contact
from forms import AddUserForm
from utils import go_permission_error, go_error, list_to_string, \
get_httpserver_root, get_ccnetapplet_root, gen_token
from seahub.profile.models import Profile
@login_required
def root(request):
@@ -552,8 +553,19 @@ def myhome(request):
groups_manage.append(group)
else:
groups_join.append(group)
#get nickname
if not Profile.objects.filter(user=request.user.username):
nickname = '暂无'
else:
profile = Profile.objects.filter(user=request.user.username)[0]
nickname = profile.nickname
if not nickname:
nickname = '暂无'
return render_to_response('myhome.html', {
"myname": email,
"nickname": nickname,
"owned_repos": owned_repos,
"quota_usage": quota_usage,
"in_repos": in_repos,