From bcc3fd5bbecdea07a2bdf0431c76894f77e6f33e Mon Sep 17 00:00:00 2001 From: zhengxie Date: Mon, 20 May 2013 13:27:44 +0800 Subject: [PATCH] Temporarily comment out user message --- seahub/settings.py | 2 +- seahub/share/views.py | 32 +++++++++---------- seahub/templates/base.html | 2 +- seahub/templates/myhome.html | 1 - seahub/templates/wiki/personal_wiki.html | 1 - .../templates/wiki/personal_wiki_pages.html | 1 - 6 files changed, 18 insertions(+), 21 deletions(-) diff --git a/seahub/settings.py b/seahub/settings.py index 3389b48d96..41a5d599f9 100644 --- a/seahub/settings.py +++ b/seahub/settings.py @@ -164,7 +164,7 @@ INSTALLED_APPS = ( 'seahub.contacts', 'seahub.wiki', 'seahub.group', - 'seahub.message', + # 'seahub.message', 'seahub.notifications', 'seahub.profile', 'seahub.share', diff --git a/seahub/share/views.py b/seahub/share/views.py index 8234d06474..2ba5e56d2c 100644 --- a/seahub/share/views.py +++ b/seahub/share/views.py @@ -28,7 +28,7 @@ from tokens import anon_share_token_generator from seahub.auth.decorators import login_required from seahub.contacts.signals import mail_sended from seahub.share.models import FileShare -from seahub.message.models import UserMessage +# from seahub.message.models import UserMessage from seahub.views import validate_owner, is_registered_user from seahub.utils import render_permission_error, string2list, render_error, \ gen_token, gen_shared_link, IS_EMAIL_CONFIGURED @@ -134,15 +134,15 @@ def share_repo(request): {'repo': repo.name, 'group': group.group_name} messages.error(request, msg) else: - members = get_group_members(group.id) + # members = get_group_members(group.id) - for email in members: - message = UserMessage() - message.to_email = email - message.from_email = request.user.username - message.message = "(by system) %s have shared repo %s to you." %(sender, head_of_repo_url +'repo/',repo.id,repo.name) - message.ifread = 0 - message.save() + # for email in members: + # message = UserMessage() + # message.to_email = email + # message.from_email = request.user.username + # message.message = "(by system) %s have shared repo %s to you." %(sender, head_of_repo_url +'repo/',repo.id,repo.name) + # message.ifread = 0 + # message.save() msg = _(u'Shared to %(group)s successfully,go check it at Share.') % \ {'group':group.group_name, 'share':reverse('share_admin')} messages.success(request, msg) @@ -172,13 +172,13 @@ def share_repo(request): msg = _(u'Failed to share to %s .') % email messages.add_message(request, messages.ERROR, msg) continue - #send message when share repo - message = UserMessage() - message.to_email = email - message.from_email = request.user.username - message.message = "(by system) %s have shared repo %s to you." %(sender, head_of_repo_url +'repo/',repo.id,repo.name) - message.ifread = 0 - message.save() + # #send message when share repo + # message = UserMessage() + # message.to_email = email + # message.from_email = request.user.username + # message.message = "(by system) %s have shared repo %s to you." %(sender, head_of_repo_url +'repo/',repo.id,repo.name) + # message.ifread = 0 + # message.save() msg = _(u'Shared to %(email)s successfully,go check it at Share.') % \ {'email':email, 'share':reverse('share_admin')} messages.add_message(request, messages.INFO, msg) diff --git a/seahub/templates/base.html b/seahub/templates/base.html index e9a0c34c3b..c44eb30f4d 100644 --- a/seahub/templates/base.html +++ b/seahub/templates/base.html @@ -42,7 +42,7 @@
{% if request.user.is_authenticated %} {% avatar request.user 16 %} {{ request.user }} - + {% trans "Log out" %} {% else %} {% trans "Log In" %} diff --git a/seahub/templates/myhome.html b/seahub/templates/myhome.html index 2d3aab9535..d0a606b4a1 100644 --- a/seahub/templates/myhome.html +++ b/seahub/templates/myhome.html @@ -13,7 +13,6 @@
  • {% trans "Libraries" %}
  • {% trans "Personal Wiki" %}
  • {% trans "Clients" %}
  • -
  • {% trans "Messages" %}
  • diff --git a/seahub/templates/wiki/personal_wiki.html b/seahub/templates/wiki/personal_wiki.html index 82cae261f1..ee12a47ac8 100644 --- a/seahub/templates/wiki/personal_wiki.html +++ b/seahub/templates/wiki/personal_wiki.html @@ -13,7 +13,6 @@
  • {% trans "Libraries" %}
  • {% trans "Personal Wiki" %}
  • {% trans "Clients" %}
  • -
  • {% trans "Messages" %}
  • diff --git a/seahub/templates/wiki/personal_wiki_pages.html b/seahub/templates/wiki/personal_wiki_pages.html index dbdfcb7b23..5de993e080 100644 --- a/seahub/templates/wiki/personal_wiki_pages.html +++ b/seahub/templates/wiki/personal_wiki_pages.html @@ -12,7 +12,6 @@