Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a499689c
authored
Jun 06, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: groupless users can see their own email
parent
5a55ce9d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
circle/dashboard/templates/dashboard/profile.html
+1
-4
circle/dashboard/views.py
+2
-0
No files found.
circle/dashboard/templates/dashboard/profile.html
View file @
a499689c
...
@@ -27,11 +27,8 @@
...
@@ -27,11 +27,8 @@
<p>
{% trans "First name" %}: {{ profile.first_name|default:"-" }}
</p>
<p>
{% trans "First name" %}: {{ profile.first_name|default:"-" }}
</p>
<p>
{% trans "Last name" %}: {{ profile.last_name|default:"-" }}
</p>
<p>
{% trans "Last name" %}: {{ profile.last_name|default:"-" }}
</p>
<p>
<p>
{# if the group list is not empty the logged in user is somewhat related to the user #}
{% if perm_email %}
{% if perm_group_list %}
{% trans "Email address" %}: {{ profile.email }}
{% trans "Email address" %}: {{ profile.email }}
{% else %}
-
{% endif %}
{% endif %}
</p>
</p>
{% if request.user == profile %}
{% if request.user == profile %}
...
...
circle/dashboard/views.py
View file @
a499689c
...
@@ -2720,6 +2720,8 @@ class ProfileView(LoginRequiredMixin, DetailView):
...
@@ -2720,6 +2720,8 @@ class ProfileView(LoginRequiredMixin, DetailView):
# to any of the groups the user belongs to
# to any of the groups the user belongs to
context
[
'perm_group_list'
]
=
(
context
[
'perm_group_list'
]
=
(
self
.
request
.
user
.
is_superuser
or
len
(
context
[
'groups'
])
>
0
)
self
.
request
.
user
.
is_superuser
or
len
(
context
[
'groups'
])
>
0
)
context
[
'perm_email'
]
=
(
context
[
'perm_group_list'
]
or
self
.
request
.
user
==
user
)
# filter the virtual machine list
# filter the virtual machine list
# if the logged in user is not superuser or not the user itself
# if the logged in user is not superuser or not the user itself
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment