@@ -1249,21 +1249,21 @@ class ProjectKey(GitlabObject):
1249
1249
requiredUrlAttrs = ['project_id' ]
1250
1250
requiredCreateAttrs = ['title' , 'key' ]
1251
1251
1252
+
1253
+ class ProjectKeyManager (BaseManager ):
1254
+ obj_cls = ProjectKey
1255
+
1252
1256
def enable (self , key_id ):
1253
1257
"""Enable a deploy key for a project."""
1254
- url = '/projects/%s/deploy_keys/%s/enable' % (self .project_id , key_id )
1258
+ url = '/projects/%s/deploy_keys/%s/enable' % (self .parent . id , key_id )
1255
1259
r = self .gitlab ._raw_post (url )
1256
- raise_error_from_response (r , GitlabProjectDeployKeyError , 200 )
1260
+ raise_error_from_response (r , GitlabProjectDeployKeyError , 201 )
1257
1261
1258
1262
def disable (self , key_id ):
1259
1263
"""Disable a deploy key for a project."""
1260
- url = '/projects/%s/deploy_keys/%s/disable' % (self .project_id , key_id )
1264
+ url = '/projects/%s/deploy_keys/%s/disable' % (self .parent . id , key_id )
1261
1265
r = self .gitlab ._raw_delete (url )
1262
- raise_error_from_response (r , GitlabProjectDeployKeyError , 200 )
1263
-
1264
-
1265
- class ProjectKeyManager (BaseManager ):
1266
- obj_cls = ProjectKey
1266
+ raise_error_from_response (r , GitlabProjectDeployKeyError , 201 )
1267
1267
1268
1268
1269
1269
class ProjectEvent (GitlabObject ):
0 commit comments