66from django .urls import reverse
77from django .utils .translation import gettext as _
88
9- from dojo .authorization .authorization_decorators import user_is_configuration_authorized
109from dojo .cicd_infrastructure .ui .forms import CICDInfrastructureForm
1110from dojo .models import CICDInfrastructure
1211from dojo .utils import add_breadcrumb
1312
1413logger = logging .getLogger (__name__ )
1514
1615
17- @user_is_configuration_authorized ("dojo.view_cicdinfrastructure" )
1816def cicd_infrastructure (request ):
1917 confs = CICDInfrastructure .objects .all ().order_by ("name" )
2018 add_breadcrumb (title = _ ("CI/CD Infrastructure List" ), top_level = not len (request .GET ), request = request )
2119 return render (request , "dojo/cicd_infrastructure.html" , {"confs" : confs })
2220
2321
24- @user_is_configuration_authorized ("dojo.add_cicdinfrastructure" )
2522def new_cicd_infrastructure (request ):
2623 if request .method == "POST" :
2724 form = CICDInfrastructureForm (request .POST )
@@ -37,7 +34,6 @@ def new_cicd_infrastructure(request):
3734 return render (request , "dojo/new_cicd_infrastructure.html" , {"form" : form })
3835
3936
40- @user_is_configuration_authorized ("dojo.change_cicdinfrastructure" )
4137def edit_cicd_infrastructure (request , ciid ):
4238 conf = get_object_or_404 (CICDInfrastructure , pk = ciid )
4339 if request .method == "POST" :
@@ -54,7 +50,6 @@ def edit_cicd_infrastructure(request, ciid):
5450 return render (request , "dojo/edit_cicd_infrastructure.html" , {"form" : form , "conf" : conf })
5551
5652
57- @user_is_configuration_authorized ("dojo.delete_cicdinfrastructure" )
5853def delete_cicd_infrastructure (request , ciid ):
5954 conf = get_object_or_404 (CICDInfrastructure , pk = ciid )
6055 if request .method == "POST" :
0 commit comments