File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change
1
+ < %inherit file="/layouts/base.html" />
2
+
3
+ < div style ="text-align: center; ">
4
+ < p > "${error}"</ p >
5
+ </ div >
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ def __call__(request):
13
13
14
14
15
15
def _q_index (request ):
16
- context = {}
17
16
current_user = request .user
18
17
if current_user and request .method == "POST" :
19
18
name = request .get_form_var ('name' )
@@ -24,12 +23,14 @@ def _q_index(request):
24
23
creator_id = current_user .id )
25
24
if p :
26
25
return request .redirect ('projects/%s' % p .name )
27
- context ['project' ] = p
28
- return st ('projects/index.html' , ** context )
26
+ has_proj = Project .get_by_name_and_owner (name , current_user .id )
27
+ error = 'Create Failure. Please contact the administrator!'
28
+ if has_proj is not None :
29
+ error = 'Project has exists, Please confirm!'
30
+ return st ('/errors/common.html' , ** locals ())
31
+
29
32
projects = Project .gets_by ()
30
- context ['projects' ] = projects
31
- context ['current_user' ] = current_user
32
- return st ('projects/index.html' , ** context )
33
+ return st ('projects/index.html' , ** locals ())
33
34
34
35
35
36
def _q_lookup (request , part ):
You can’t perform that action at this time.
0 commit comments