Commit c78f027d authored by Giorgos Korfiatis's avatar Giorgos Korfiatis Committed by Georgios D. Tsoukalas
Browse files

Do not expose names of project members

parent a4f34a02
......@@ -64,10 +64,7 @@ EMAIL_CHANGE_REGISTERED = 'Your request for changing your emai
A verification email will be sent to your new address.'
OBJECT_CREATED = 'The %(verbose_name)s was created successfully.'
USER_JOINED_GROUP = 'User %(realname)s joined the project.'
USER_LEFT_GROUP = 'User %(realname)s left the project.'
USER_MEMBERSHIP_REJECTED = '%(realname)s\'s request to join the project has been rejected.'
MEMBER_REMOVED = 'User %(realname)s has been successfully removed from the project.'
USER_MEMBERSHIP_REJECTED = 'Request by %s to join the project has been rejected.'
BILLING_ERROR = 'Service response status: %(status)d'
LOGOUT_SUCCESS = 'Logged out successfully.'
LOGIN_SUCCESS = 'Logged in successfully, using %s.'
......@@ -183,8 +180,8 @@ UNKNOWN_PROJECT_APPLICATION_ID = 'There is no project application ide
UNKNOWN_PROJECT_ID = 'There is no project identified by %s.'
UNKNOWN_IDENTIFIER = 'Unknown identifier.'
PENDING_MEMBERSHIP_LEAVE = 'Your request is pending moderation by the Project owner.'
USER_MEMBERSHIP_ACCEPTED = '%(realname)s has been accepted in the project.'
USER_MEMBERSHIP_REMOVED = '%(realname)s has been removed from the project.'
USER_MEMBERSHIP_ACCEPTED = '%s has been accepted in the project.'
USER_MEMBERSHIP_REMOVED = '%s has been removed from the project.'
USER_LEFT_PROJECT = 'You have left the project.'
USER_LEAVE_REQUEST_SUBMITTED = 'Your request to leave the project has been submitted successfully.'
USER_JOIN_REQUEST_SUBMITTED = 'Your request to join the project has been submitted successfully.'
......
......@@ -49,7 +49,7 @@ def membership_request_notify(project, requested_user):
[project.application.owner.email],
_(settings.PROJECT_MEMBERSHIP_REQUEST_SUBJECT) % project.__dict__,
template= 'im/projects/project_membership_request_notification.txt',
dictionary={'object':project, 'user':requested_user.realname})
dictionary={'object':project, 'user':requested_user.email})
notification.send()
except NotificationError, e:
logger.error(e.message)
......@@ -61,7 +61,7 @@ def membership_leave_request_notify(project, requested_user):
[project.application.owner.email],
_(settings.PROJECT_MEMBERSHIP_LEAVE_REQUEST_SUBJECT) % project.__dict__,
template= 'im/projects/project_membership_leave_request_notification.txt',
dictionary={'object':project, 'user':requested_user.realname})
dictionary={'object':project, 'user':requested_user.email})
notification.send()
except NotificationError, e:
logger.error(e.message)
......
......@@ -350,7 +350,6 @@ def member_action_extra_context(membership, table, col):
return context
class ProjectMembersTable(UserTable):
name = tables.Column(accessor="person.last_name", verbose_name=_('Name'))
email = tables.Column(accessor="person.email", verbose_name=_('Email'))
status = tables.Column(accessor="state", verbose_name=_('Status'))
project_action = RichLinkColumn(verbose_name=_('Action'),
......@@ -364,18 +363,11 @@ class ProjectMembersTable(UserTable):
if not self.user.owns_project(self.project):
self.exclude = ('project_action', )
def render_name(self, value, record, *args, **kwargs):
return record.person.realname
def render_status(self, value, record, *args, **kwargs):
return record.state_display()
class Meta:
template = "im/table_render.html"
model = ProjectMembership
fields = ('name', 'status')
sequence = ('name', 'email', 'status', 'project_action')
attrs = {'id': 'members-table', 'class': 'members-table alt-style'}
empty_text = _('No members')
......@@ -1441,8 +1441,8 @@ def project_accept_member(request, chain_id, user_id, ctx=None):
if ctx:
ctx.mark_rollback()
else:
realname = escape(m.person.realname)
msg = _(astakos_messages.USER_MEMBERSHIP_ACCEPTED) % locals()
email = escape(m.person.email)
msg = _(astakos_messages.USER_MEMBERSHIP_ACCEPTED) % email
messages.success(request, msg)
return redirect(reverse('project_detail', args=(chain_id,)))
......@@ -1465,8 +1465,8 @@ def project_remove_member(request, chain_id, user_id, ctx=None):
if ctx:
ctx.mark_rollback()
else:
realname = escape(m.person.realname)
msg = _(astakos_messages.USER_MEMBERSHIP_REMOVED) % locals()
email = escape(m.person.email)
msg = _(astakos_messages.USER_MEMBERSHIP_REMOVED) % email
messages.success(request, msg)
return redirect(reverse('project_detail', args=(chain_id,)))
......@@ -1489,8 +1489,8 @@ def project_reject_member(request, chain_id, user_id, ctx=None):
if ctx:
ctx.mark_rollback()
else:
realname = escape(m.person.realname)
msg = _(astakos_messages.USER_MEMBERSHIP_REJECTED) % locals()
email = escape(m.person.email)
msg = _(astakos_messages.USER_MEMBERSHIP_REJECTED) % email
messages.success(request, msg)
return redirect(reverse('project_detail', args=(chain_id,)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment