Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
itminedu
synnefo
Commits
9b7a5d22
Commit
9b7a5d22
authored
Jul 11, 2014
by
Alex Pyrgiotis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
admin: Return contact info for system projects
Fix apyrgio/synnefo#214 Fix apyrgio/synnefo#213
parent
5d19bf33
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
snf-admin-app/synnefo_admin/admin/projects/utils.py
snf-admin-app/synnefo_admin/admin/projects/utils.py
+18
-6
No files found.
snf-admin-app/synnefo_admin/admin/projects/utils.py
View file @
9b7a5d22
...
...
@@ -48,6 +48,15 @@ from synnefo_admin.admin.actions import (AdminAction, noop,
has_permission_or_403
)
def
get_actual_owner
(
inst
):
if
inst
.
owner
:
return
inst
.
owner
try
:
return
inst
.
members
.
all
()[
0
]
except
IndexError
:
return
None
def
get_project
(
query
):
try
:
project
=
Project
.
objects
.
get
(
id
=
query
)
...
...
@@ -57,18 +66,21 @@ def get_project(query):
def
get_contact_email
(
inst
):
if
inst
.
owner
:
return
inst
.
owner
.
email
,
owner
=
get_actual_owner
(
inst
)
if
owner
:
return
owner
.
email
def
get_contact_name
(
inst
):
if
inst
.
owner
:
return
inst
.
owner
.
realname
,
owner
=
get_actual_owner
(
inst
)
if
owner
:
return
owner
.
realname
def
get_contact_id
(
inst
):
if
inst
.
owner
:
return
inst
.
owner
.
uuid
owner
=
get_actual_owner
(
inst
)
if
owner
:
return
owner
.
uuid
def
get_policies
(
inst
):
...
...
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