From: Ciro Scognamiglio Date: Wed, 15 Apr 2015 15:28:59 +0000 (+0200) Subject: project request fix X-Git-Tag: myslice-1.3~37^2~16 X-Git-Url: http://git.onelab.eu/?p=unfold.git;a=commitdiff_plain;h=d740d228d416514bf7aeeb5c6ff67339e34748ee project request fix --- diff --git a/portal/projectrequestview.py b/portal/projectrequestview.py index 51f33dd7..5fd7d8cb 100644 --- a/portal/projectrequestview.py +++ b/portal/projectrequestview.py @@ -109,6 +109,10 @@ class ProjectRequestView(LoginRequiredAutoLogoutView, ThemeView): 'project_name' : wsgi_request.POST.get('project_name', ''), 'purpose' : wsgi_request.POST.get('purpose', ''), } + + # for new projects max project_name length is 10 + if (len(post['project_name']) >10): + errors.append('Project name can be maximum 10 characters long') #if (post['authority_hrn'] is None or post['authority_hrn'] == ''): # errors.append('Organization is mandatory') @@ -121,12 +125,7 @@ class ProjectRequestView(LoginRequiredAutoLogoutView, ThemeView): # What kind of project name is valid? if (post['project_name'] is None or post['project_name'] == ''): - errors.append('Project name is mandatory') - - # max project_name length is 10 - if (len(post['project_name']) >10): - errors.append('Project name can be maximum 10 characters long') - + errors.append('Project name is mandatory') if not errors: logger.info("is_pi on auth_hrn = {}".format(user_authority)) diff --git a/portal/templates/fed4fire/fed4fire_projectrequest_view.html b/portal/templates/fed4fire/fed4fire_projectrequest_view.html index be597501..45d8a1af 100644 --- a/portal/templates/fed4fire/fed4fire_projectrequest_view.html +++ b/portal/templates/fed4fire/fed4fire_projectrequest_view.html @@ -1,11 +1,12 @@ {% extends "layout.html" %} {% load i18n %} - -{% block content %} +{% block head %} +{% endblock head %} +{% block content %}
@@ -85,7 +86,10 @@
{% csrf_token %}
Loading projects
- + +