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