mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-04 16:31:13 +00:00
Fixed bug in show group message in home page
This commit is contained in:
@@ -34,7 +34,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if grpmsg_list or grpmsg_reply_list or orgmsg_list %}
|
{% if grpmsg_list or grpmsg_reply_list %}
|
||||||
<div class="info-item">
|
<div class="info-item">
|
||||||
<h3 class="info-item-top">{% trans "Reminding..." %}</h3>
|
<h3 class="info-item-top">{% trans "Reminding..." %}</h3>
|
||||||
<ul class="info-item-bottom">
|
<ul class="info-item-bottom">
|
||||||
@@ -57,14 +57,6 @@
|
|||||||
{% endblocktrans %}</a></li>
|
{% endblocktrans %}</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if orgmsg_list %}
|
|
||||||
<li><a href="{% url 'org_msg' %}" class="no-bold">
|
|
||||||
{% blocktrans count counter=orgmsg_list|length %}
|
|
||||||
one org message
|
|
||||||
{% plural %}
|
|
||||||
{{ counter }} org messages
|
|
||||||
{% endblocktrans %}</a></li>
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@@ -816,18 +816,16 @@ def myhome(request):
|
|||||||
# user notifications
|
# user notifications
|
||||||
grpmsg_list = []
|
grpmsg_list = []
|
||||||
grpmsg_reply_list = []
|
grpmsg_reply_list = []
|
||||||
orgmsg_list = []
|
joined_group_ids = [x.id for x in joined_groups]
|
||||||
notes = UserNotification.objects.filter(to_user=request.user.username)
|
notes = UserNotification.objects.filter(to_user=request.user.username)
|
||||||
for n in notes:
|
for n in notes:
|
||||||
if n.msg_type == 'group_msg':
|
if n.msg_type == 'group_msg':
|
||||||
grp = get_group(n.detail)
|
if int(n.detail) not in joined_group_ids:
|
||||||
if not grp:
|
|
||||||
continue
|
continue
|
||||||
|
grp = get_group(int(n.detail))
|
||||||
grpmsg_list.append(grp)
|
grpmsg_list.append(grp)
|
||||||
elif n.msg_type == 'grpmsg_reply':
|
elif n.msg_type == 'grpmsg_reply':
|
||||||
grpmsg_reply_list.append(n.detail)
|
grpmsg_reply_list.append(n.detail)
|
||||||
elif n.msg_type == 'org_join_msg':
|
|
||||||
orgmsg_list.append(n.detail)
|
|
||||||
|
|
||||||
# get nickname
|
# get nickname
|
||||||
profiles = Profile.objects.filter(user=request.user.username)
|
profiles = Profile.objects.filter(user=request.user.username)
|
||||||
@@ -836,15 +834,7 @@ def myhome(request):
|
|||||||
autocomp_groups = joined_groups
|
autocomp_groups = joined_groups
|
||||||
contacts = Contact.objects.get_registered_contacts_by_user(email)
|
contacts = Contact.objects.get_registered_contacts_by_user(email)
|
||||||
|
|
||||||
|
allow_public_share = False if request.cloud_mode else True
|
||||||
if request.cloud_mode:
|
|
||||||
allow_public_share = False
|
|
||||||
else:
|
|
||||||
allow_public_share = True
|
|
||||||
|
|
||||||
# Clear org messages just in case. Should never happen in production
|
|
||||||
# environment.
|
|
||||||
orgmsg_list = []
|
|
||||||
|
|
||||||
# events
|
# events
|
||||||
if EVENTS_ENABLED:
|
if EVENTS_ENABLED:
|
||||||
@@ -882,7 +872,6 @@ def myhome(request):
|
|||||||
"notes": notes,
|
"notes": notes,
|
||||||
"grpmsg_list": grpmsg_list,
|
"grpmsg_list": grpmsg_list,
|
||||||
"grpmsg_reply_list": grpmsg_reply_list,
|
"grpmsg_reply_list": grpmsg_reply_list,
|
||||||
"orgmsg_list": orgmsg_list,
|
|
||||||
"create_shared_repo": False,
|
"create_shared_repo": False,
|
||||||
"allow_public_share": allow_public_share,
|
"allow_public_share": allow_public_share,
|
||||||
"events": events,
|
"events": events,
|
||||||
|
Reference in New Issue
Block a user