Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
ng6
Commits
3418585b
Commit
3418585b
authored
Apr 01, 2015
by
Penom Nom
Browse files
fix project name on add_run in GUI
parent
3a895c22
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/ng6/ng6workflow.py
View file @
3418585b
...
...
@@ -214,10 +214,9 @@ class NG6Workflow (BasicNG6Workflow):
def
pre_process
(
self
):
BasicNG6Workflow
.
pre_process
(
self
)
project_id
=
self
.
project_name
# start from an existing project
self
.
project
=
Project
.
get_from_
id
(
project_
id
)
self
.
metadata
.
append
(
"project_id="
+
str
(
project
_
id
))
self
.
project
=
Project
.
get_from_
name
(
self
.
project_
name
)
self
.
metadata
.
append
(
"project_id="
+
str
(
self
.
project
.
id
))
# if user is not allowed to add data on project (is not admin)
if
self
.
project
is
not
None
and
not
self
.
project
.
is_admin
(
self
.
admin_login
):
display_error_message
(
"The user login '"
+
self
.
admin_login
+
"' is not allowed to add data on project '"
+
self
.
project
.
name
+
"'.
\n
"
)
...
...
src/ng6/project.py
View file @
3418585b
...
...
@@ -157,6 +157,22 @@ class Project(object):
except
:
return
None
@
staticmethod
def
get_from_name
(
name
):
"""
Return a project object specified by its name
@param name : the project name
"""
try
:
t3mysql
=
t3MySQLdb
()
[
id
,
description
]
=
t3mysql
.
select_project_from_name
(
name
)
return
Project
(
name
,
description
,
None
,
id
)
except
:
return
None
@
staticmethod
def
get_from_run_id
(
id
):
"""
...
...
ui/nG6/pi1/project_view.tpl
View file @
3418585b
...
...
@@ -98,6 +98,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{
if
$login_user
}
<div
class=
"tab-pane fade"
id=
"users"
>
<input
type=
"hidden"
id=
"current_project_id"
value=
"
{
$projects
[
key
(
$projects
)].
id
}
"
/>
<input
type=
"hidden"
id=
"current_project_name"
value=
"
{
$projects
[
key
(
$projects
)].
name
}
"
/>
<p>
{
if
$projects
[
key
(
$projects
)].
is_admin
}
In the table below are listed all users with an access to the project.
...
...
ui/nG6/res/js/tx_nG6_pi1.js
View file @
3418585b
...
...
@@ -1834,6 +1834,7 @@ function addRunHandler() {
var
parameters
=
{}
if
(
$
(
"
#view
"
).
val
()
==
"
project
"
)
{
parameters
=
{
"
project_id
"
:
$
(
"
#ids
"
).
val
()};
parameters
=
{
"
project_name
"
:
$
(
"
#current_project_name
"
).
val
()};
}
parameters
[
"
admin_login
"
]
=
$
(
"
#user_login
"
).
val
();
...
...
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