Commit 3418585b authored by Penom Nom's avatar Penom Nom
Browse files

fix project name on add_run in GUI

parent 3a895c22
......@@ -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" )
......
......@@ -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):
"""
......
......@@ -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.
......
......@@ -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();
......
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