File tree 2 files changed +14
-2
lines changed 2 files changed +14
-2
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 @@ -24,8 +24,15 @@ def _q_index(request):
24
24
creator_id = current_user .id )
25
25
if p :
26
26
return request .redirect ('%s' % p .repo_name )
27
- context ['project' ] = p
28
- return st ('projects/index.html' , ** context )
27
+ has_proj = Project .get_by_name_and_owner (name , current_user .id )
28
+ default_error = 'Create Failure. Please contact the administrator!'
29
+ if has_proj is not None :
30
+ context ['error' ] = 'Project has exists, Please confirm!'
31
+ else :
32
+ context ['error' ] = default_error
33
+ context ['current_user' ] = current_user
34
+ return st ('/errors/common.html' , ** context )
35
+
29
36
projects = Project .gets_by ()
30
37
context ['projects' ] = projects
31
38
context ['current_user' ] = current_user
You can’t perform that action at this time.
0 commit comments