| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 824151c commit 12435d7
19 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -217,6 +217,15 @@ def get_id(self) -> Any: | |||
| 217 | 217 | return None | |
| 218 | 218 | return getattr(self, self._id_attr) | |
| 219 | 219 | ||
| 220 | + @property | ||
| 221 | + def encoded_id(self) -> Any: | ||
| 222 | + """Ensure that the ID is url-encoded so that it can be safely used in a URL | ||
| 223 | + path""" | ||
| 224 | + obj_id = self.get_id() | ||
| 225 | + if isinstance(obj_id, str): | ||
| 226 | + obj_id = gitlab.utils._url_encode(obj_id) | ||
| 227 | + return obj_id | ||
| 228 | + | ||
| 220 | 229 | @property | |
| 221 | 230 | def attributes(self) -> Dict[str, Any]: | |
| 222 | 231 | d = self.__dict__["_updated_attrs"].copy() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -99,8 +99,7 @@ def get( | |||
| 99 | 99 | GitlabAuthenticationError: If authentication is not correct | |
| 100 | 100 | GitlabGetError: If the server cannot perform the request | |
| 101 | 101 | """ | |
| 102 | - if not isinstance(id, int): | ||
| 103 | - id = utils._url_encode(id) | ||
| 102 | + id = utils._url_encode(id) | ||
| 104 | 103 | path = f"{self.path}/{id}" | |
| 105 | 104 | if TYPE_CHECKING: | |
| 106 | 105 | assert self._obj_cls is not None | |
@@ -173,7 +172,7 @@ def refresh(self, **kwargs: Any) -> None: | |||
| 173 | 172 | GitlabGetError: If the server cannot perform the request | |
| 174 | 173 | """ | |
| 175 | 174 | if self._id_attr: | |
| 176 | - path = f"{self.manager.path}/{self.id}" | ||
| 175 | + path = f"{self.manager.path}/{self.encoded_id}" | ||
| 177 | 176 | else: | |
| 178 | 177 | if TYPE_CHECKING: | |
| 179 | 178 | assert self.manager.path is not None | |
@@ -391,7 +390,7 @@ def update( | |||
| 391 | 390 | if id is None: | |
| 392 | 391 | path = self.path | |
| 393 | 392 | else: | |
| 394 | - path = f"{self.path}/{id}" | ||
| 393 | + path = f"{self.path}/{utils._url_encode(id)}" | ||
| 395 | 394 | ||
| 396 | 395 | self._check_missing_update_attrs(new_data) | |
| 397 | 396 | files = {} | |
@@ -477,9 +476,7 @@ def delete(self, id: Union[str, int], **kwargs: Any) -> None: | |||
| 477 | 476 | if id is None: | |
| 478 | 477 | path = self.path | |
| 479 | 478 | else: | |
| 480 | - if not isinstance(id, int): | ||
| 481 | - id = utils._url_encode(id) | ||
| 482 | - path = f"{self.path}/{id}" | ||
| 479 | + path = f"{self.path}/{utils._url_encode(id)}" | ||
| 483 | 480 | self.gitlab.http_delete(path, **kwargs) | |
| 484 | 481 | ||
| 485 | 482 | ||
@@ -545,6 +542,7 @@ def save(self, **kwargs: Any) -> None: | |||
| 545 | 542 | return | |
| 546 | 543 | ||
| 547 | 544 | # call the manager | |
| 545 | + # Don't use `self.encoded_id` here as `self.manager.update()` will encode it. | ||
| 548 | 546 | obj_id = self.get_id() | |
| 549 | 547 | if TYPE_CHECKING: | |
| 550 | 548 | assert isinstance(self.manager, UpdateMixin) | |
@@ -575,6 +573,7 @@ def delete(self, **kwargs: Any) -> None: | |||
| 575 | 573 | """ | |
| 576 | 574 | if TYPE_CHECKING: | |
| 577 | 575 | assert isinstance(self.manager, DeleteMixin) | |
| 576 | + # Don't use `self.encoded_id` here as `self.manager.delete()` will encode it. | ||
| 578 | 577 | self.manager.delete(self.get_id(), **kwargs) | |
| 579 | 578 | ||
| 580 | 579 | ||
@@ -598,7 +597,7 @@ def user_agent_detail(self, **kwargs: Any) -> Dict[str, Any]: | |||
| 598 | 597 | GitlabAuthenticationError: If authentication is not correct | |
| 599 | 598 | GitlabGetError: If the server cannot perform the request | |
| 600 | 599 | """ | |
| 601 | - path = f"{self.manager.path}/{self.get_id()}/user_agent_detail" | ||
| 600 | + path = f"{self.manager.path}/{self.encoded_id}/user_agent_detail" | ||
| 602 | 601 | result = self.manager.gitlab.http_get(path, **kwargs) | |
| 603 | 602 | if TYPE_CHECKING: | |
| 604 | 603 | assert not isinstance(result, requests.Response) | |
@@ -631,7 +630,7 @@ def approve( | |||
| 631 | 630 | GitlabUpdateError: If the server fails to perform the request | |
| 632 | 631 | """ | |
| 633 | 632 | ||
| 634 | - path = f"{self.manager.path}/{self.id}/approve" | ||
| 633 | + path = f"{self.manager.path}/{self.encoded_id}/approve" | ||
| 635 | 634 | data = {"access_level": access_level} | |
| 636 | 635 | server_data = self.manager.gitlab.http_put(path, post_data=data, **kwargs) | |
| 637 | 636 | if TYPE_CHECKING: | |
@@ -705,7 +704,7 @@ def subscribe(self, **kwargs: Any) -> None: | |||
| 705 | 704 | GitlabAuthenticationError: If authentication is not correct | |
| 706 | 705 | GitlabSubscribeError: If the subscription cannot be done | |
| 707 | 706 | """ | |
| 708 | - path = f"{self.manager.path}/{self.get_id()}/subscribe" | ||
| 707 | + path = f"{self.manager.path}/{self.encoded_id}/subscribe" | ||
| 709 | 708 | server_data = self.manager.gitlab.http_post(path, **kwargs) | |
| 710 | 709 | if TYPE_CHECKING: | |
| 711 | 710 | assert not isinstance(server_data, requests.Response) | |
@@ -725,7 +724,7 @@ def unsubscribe(self, **kwargs: Any) -> None: | |||
| 725 | 724 | GitlabAuthenticationError: If authentication is not correct | |
| 726 | 725 | GitlabUnsubscribeError: If the unsubscription cannot be done | |
| 727 | 726 | """ | |
| 728 | - path = f"{self.manager.path}/{self.get_id()}/unsubscribe" | ||
| 727 | + path = f"{self.manager.path}/{self.encoded_id}/unsubscribe" | ||
| 729 | 728 | server_data = self.manager.gitlab.http_post(path, **kwargs) | |
| 730 | 729 | if TYPE_CHECKING: | |
| 731 | 730 | assert not isinstance(server_data, requests.Response) | |
@@ -752,7 +751,7 @@ def todo(self, **kwargs: Any) -> None: | |||
| 752 | 751 | GitlabAuthenticationError: If authentication is not correct | |
| 753 | 752 | GitlabTodoError: If the todo cannot be set | |
| 754 | 753 | """ | |
| 755 | - path = f"{self.manager.path}/{self.get_id()}/todo" | ||
| 754 | + path = f"{self.manager.path}/{self.encoded_id}/todo" | ||
| 756 | 755 | self.manager.gitlab.http_post(path, **kwargs) | |
| 757 | 756 | ||
| 758 | 757 | ||
@@ -781,7 +780,7 @@ def time_stats(self, **kwargs: Any) -> Dict[str, Any]: | |||
| 781 | 780 | if "time_stats" in self.attributes: | |
| 782 | 781 | return self.attributes["time_stats"] | |
| 783 | 782 | ||
| 784 | - path = f"{self.manager.path}/{self.get_id()}/time_stats" | ||
| 783 | + path = f"{self.manager.path}/{self.encoded_id}/time_stats" | ||
| 785 | 784 | result = self.manager.gitlab.http_get(path, **kwargs) | |
| 786 | 785 | if TYPE_CHECKING: | |
| 787 | 786 | assert not isinstance(result, requests.Response) | |
@@ -800,7 +799,7 @@ def time_estimate(self, duration: str, **kwargs: Any) -> Dict[str, Any]: | |||
| 800 | 799 | GitlabAuthenticationError: If authentication is not correct | |
| 801 | 800 | GitlabTimeTrackingError: If the time tracking update cannot be done | |
| 802 | 801 | """ | |
| 803 | - path = f"{self.manager.path}/{self.get_id()}/time_estimate" | ||
| 802 | + path = f"{self.manager.path}/{self.encoded_id}/time_estimate" | ||
| 804 | 803 | data = {"duration": duration} | |
| 805 | 804 | result = self.manager.gitlab.http_post(path, post_data=data, **kwargs) | |
| 806 | 805 | if TYPE_CHECKING: | |
@@ -819,7 +818,7 @@ def reset_time_estimate(self, **kwargs: Any) -> Dict[str, Any]: | |||
| 819 | 818 | GitlabAuthenticationError: If authentication is not correct | |
| 820 | 819 | GitlabTimeTrackingError: If the time tracking update cannot be done | |
| 821 | 820 | """ | |
| 822 | - path = f"{self.manager.path}/{self.get_id()}/reset_time_estimate" | ||
| 821 | + path = f"{self.manager.path}/{self.encoded_id}/reset_time_estimate" | ||
| 823 | 822 | result = self.manager.gitlab.http_post(path, **kwargs) | |
| 824 | 823 | if TYPE_CHECKING: | |
| 825 | 824 | assert not isinstance(result, requests.Response) | |
@@ -838,7 +837,7 @@ def add_spent_time(self, duration: str, **kwargs: Any) -> Dict[str, Any]: | |||
| 838 | 837 | GitlabAuthenticationError: If authentication is not correct | |
| 839 | 838 | GitlabTimeTrackingError: If the time tracking update cannot be done | |
| 840 | 839 | """ | |
| 841 | - path = f"{self.manager.path}/{self.get_id()}/add_spent_time" | ||
| 840 | + path = f"{self.manager.path}/{self.encoded_id}/add_spent_time" | ||
| 842 | 841 | data = {"duration": duration} | |
| 843 | 842 | result = self.manager.gitlab.http_post(path, post_data=data, **kwargs) | |
| 844 | 843 | if TYPE_CHECKING: | |
@@ -857,7 +856,7 @@ def reset_spent_time(self, **kwargs: Any) -> Dict[str, Any]: | |||
| 857 | 856 | GitlabAuthenticationError: If authentication is not correct | |
| 858 | 857 | GitlabTimeTrackingError: If the time tracking update cannot be done | |
| 859 | 858 | """ | |
| 860 | - path = f"{self.manager.path}/{self.get_id()}/reset_spent_time" | ||
| 859 | + path = f"{self.manager.path}/{self.encoded_id}/reset_spent_time" | ||
| 861 | 860 | result = self.manager.gitlab.http_post(path, **kwargs) | |
| 862 | 861 | if TYPE_CHECKING: | |
| 863 | 862 | assert not isinstance(result, requests.Response) | |
@@ -893,7 +892,7 @@ def participants(self, **kwargs: Any) -> Dict[str, Any]: | |||
| 893 | 892 | The list of participants | |
| 894 | 893 | """ | |
| 895 | 894 | ||
| 896 | - path = f"{self.manager.path}/{self.get_id()}/participants" | ||
| 895 | + path = f"{self.manager.path}/{self.encoded_id}/participants" | ||
| 897 | 896 | result = self.manager.gitlab.http_get(path, **kwargs) | |
| 898 | 897 | if TYPE_CHECKING: | |
| 899 | 898 | assert not isinstance(result, requests.Response) | |
@@ -967,7 +966,7 @@ def promote(self, **kwargs: Any) -> Dict[str, Any]: | |||
| 967 | 966 | The updated object data (*not* a RESTObject) | |
| 968 | 967 | """ | |
| 969 | 968 | ||
| 970 | - path = f"{self.manager.path}/{self.id}/promote" | ||
| 969 | + path = f"{self.manager.path}/{self.encoded_id}/promote" | ||
| 971 | 970 | http_method = self._get_update_method() | |
| 972 | 971 | result = http_method(path, **kwargs) | |
| 973 | 972 | if TYPE_CHECKING: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ | |||
| 16 | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 17 | 17 | ||
| 18 | 18 | import urllib.parse | |
| 19 | - from typing import Any, Callable, Dict, Optional | ||
| 19 | + from typing import Any, Callable, Dict, Optional, overload, Union | ||
| 20 | 20 | ||
| 21 | 21 | import requests | |
| 22 | 22 | ||
@@ -56,7 +56,17 @@ def copy_dict(dest: Dict[str, Any], src: Dict[str, Any]) -> None: | |||
| 56 | 56 | dest[k] = v | |
| 57 | 57 | ||
| 58 | 58 | ||
| 59 | + @overload | ||
| 60 | + def _url_encode(id: int) -> int: | ||
| 61 | + ... | ||
| 62 | + | ||
| 63 | + | ||
| 64 | + @overload | ||
| 59 | 65 | def _url_encode(id: str) -> str: | |
| 66 | + ... | ||
| 67 | + | ||
| 68 | + | ||
| 69 | + def _url_encode(id: Union[int, str]) -> Union[int, str]: | ||
| 60 | 70 | """Encode/quote the characters in the string so that they can be used in a path. | |
| 61 | 71 | ||
| 62 | 72 | Reference to documentation on why this is necessary. | |
@@ -74,6 +84,8 @@ def _url_encode(id: str) -> str: | |||
| 74 | 84 | parameters. | |
| 75 | 85 | ||
| 76 | 86 | """ | |
| 87 | + if isinstance(id, int): | ||
| 88 | + return id | ||
| 77 | 89 | return urllib.parse.quote(id, safe="") | |
| 78 | 90 | ||
| 79 | 91 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,7 +42,7 @@ def diff(self, **kwargs: Any) -> Union[gitlab.GitlabList, List[Dict[str, Any]]]: | |||
| 42 | 42 | Returns: | |
| 43 | 43 | The changes done in this commit | |
| 44 | 44 | """ | |
| 45 | - path = f"{self.manager.path}/{self.get_id()}/diff" | ||
| 45 | + path = f"{self.manager.path}/{self.encoded_id}/diff" | ||
| 46 | 46 | return self.manager.gitlab.http_list(path, **kwargs) | |
| 47 | 47 | ||
| 48 | 48 | @cli.register_custom_action("ProjectCommit", ("branch",)) | |
@@ -58,7 +58,7 @@ def cherry_pick(self, branch: str, **kwargs: Any) -> None: | |||
| 58 | 58 | GitlabAuthenticationError: If authentication is not correct | |
| 59 | 59 | GitlabCherryPickError: If the cherry-pick could not be performed | |
| 60 | 60 | """ | |
| 61 | - path = f"{self.manager.path}/{self.get_id()}/cherry_pick" | ||
| 61 | + path = f"{self.manager.path}/{self.encoded_id}/cherry_pick" | ||
| 62 | 62 | post_data = {"branch": branch} | |
| 63 | 63 | self.manager.gitlab.http_post(path, post_data=post_data, **kwargs) | |
| 64 | 64 | ||
@@ -80,7 +80,7 @@ def refs( | |||
| 80 | 80 | Returns: | |
| 81 | 81 | The references the commit is pushed to. | |
| 82 | 82 | """ | |
| 83 | - path = f"{self.manager.path}/{self.get_id()}/refs" | ||
| 83 | + path = f"{self.manager.path}/{self.encoded_id}/refs" | ||
| 84 | 84 | query_data = {"type": type} | |
| 85 | 85 | return self.manager.gitlab.http_list(path, query_data=query_data, **kwargs) | |
| 86 | 86 | ||
@@ -101,7 +101,7 @@ def merge_requests( | |||
| 101 | 101 | Returns: | |
| 102 | 102 | The merge requests related to the commit. | |
| 103 | 103 | """ | |
| 104 | - path = f"{self.manager.path}/{self.get_id()}/merge_requests" | ||
| 104 | + path = f"{self.manager.path}/{self.encoded_id}/merge_requests" | ||
| 105 | 105 | return self.manager.gitlab.http_list(path, **kwargs) | |
| 106 | 106 | ||
| 107 | 107 | @cli.register_custom_action("ProjectCommit", ("branch",)) | |
@@ -122,7 +122,7 @@ def revert( | |||
| 122 | 122 | Returns: | |
| 123 | 123 | The new commit data (*not* a RESTObject) | |
| 124 | 124 | """ | |
| 125 | - path = f"{self.manager.path}/{self.get_id()}/revert" | ||
| 125 | + path = f"{self.manager.path}/{self.encoded_id}/revert" | ||
| 126 | 126 | post_data = {"branch": branch} | |
| 127 | 127 | return self.manager.gitlab.http_post(path, post_data=post_data, **kwargs) | |
| 128 | 128 | ||
@@ -141,7 +141,7 @@ def signature(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]: | |||
| 141 | 141 | Returns: | |
| 142 | 142 | The commit's signature data | |
| 143 | 143 | """ | |
| 144 | - path = f"{self.manager.path}/{self.get_id()}/signature" | ||
| 144 | + path = f"{self.manager.path}/{self.encoded_id}/signature" | ||
| 145 | 145 | return self.manager.gitlab.http_get(path, **kwargs) | |
| 146 | 146 | ||
| 147 | 147 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,7 +36,7 @@ def stop(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]: | |||
| 36 | 36 | Returns: | |
| 37 | 37 | A dict of the result. | |
| 38 | 38 | """ | |
| 39 | - path = f"{self.manager.path}/{self.get_id()}/stop" | ||
| 39 | + path = f"{self.manager.path}/{self.encoded_id}/stop" | ||
| 40 | 40 | return self.manager.gitlab.http_post(path, **kwargs) | |
| 41 | 41 | ||
| 42 | 42 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -72,7 +72,7 @@ def save(self, **kwargs: Any) -> None: | |||
| 72 | 72 | return | |
| 73 | 73 | ||
| 74 | 74 | # call the manager | |
| 75 | - obj_id = self.get_id() | ||
| 75 | + obj_id = self.encoded_id | ||
| 76 | 76 | self.manager.update(obj_id, updated_data, **kwargs) | |
| 77 | 77 | ||
| 78 | 78 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -76,7 +76,7 @@ def delete( # type: ignore | |||
| 76 | 76 | GitlabAuthenticationError: If authentication is not correct | |
| 77 | 77 | GitlabDeleteError: If the server cannot perform the request | |
| 78 | 78 | """ | |
| 79 | - file_path = utils._url_encode(self.get_id()) | ||
| 79 | + file_path = self.encoded_id | ||
| 80 | 80 | self.manager.delete(file_path, branch, commit_message, **kwargs) | |
| 81 | 81 | ||
| 82 | 82 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,7 +30,7 @@ def repair(self, **kwargs: Any) -> None: | |||
| 30 | 30 | GitlabAuthenticationError: If authentication is not correct | |
| 31 | 31 | GitlabRepairError: If the server failed to perform the request | |
| 32 | 32 | """ | |
| 33 | - path = f"/geo_nodes/{self.get_id()}/repair" | ||
| 33 | + path = f"/geo_nodes/{self.encoded_id}/repair" | ||
| 34 | 34 | server_data = self.manager.gitlab.http_post(path, **kwargs) | |
| 35 | 35 | if TYPE_CHECKING: | |
| 36 | 36 | assert isinstance(server_data, dict) | |
@@ -51,7 +51,7 @@ def status(self, **kwargs: Any) -> Dict[str, Any]: | |||
| 51 | 51 | Returns: | |
| 52 | 52 | The status of the geo node | |
| 53 | 53 | """ | |
| 54 | - path = f"/geo_nodes/{self.get_id()}/status" | ||
| 54 | + path = f"/geo_nodes/{self.encoded_id}/status" | ||
| 55 | 55 | result = self.manager.gitlab.http_get(path, **kwargs) | |
| 56 | 56 | if TYPE_CHECKING: | |
| 57 | 57 | assert isinstance(result, dict) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -115,7 +115,7 @@ def search( | |||
| 115 | 115 | A list of dicts describing the resources found. | |
| 116 | 116 | """ | |
| 117 | 117 | data = {"scope": scope, "search": search} | |
| 118 | - path = f"/groups/{self.get_id()}/search" | ||
| 118 | + path = f"/groups/{self.encoded_id}/search" | ||
| 119 | 119 | return self.manager.gitlab.http_list(path, query_data=data, **kwargs) | |
| 120 | 120 | ||
| 121 | 121 | @cli.register_custom_action("Group", ("cn", "group_access", "provider")) | |
@@ -136,7 +136,7 @@ def add_ldap_group_link( | |||
| 136 | 136 | GitlabAuthenticationError: If authentication is not correct | |
| 137 | 137 | GitlabCreateError: If the server cannot perform the request | |
| 138 | 138 | """ | |
| 139 | - path = f"/groups/{self.get_id()}/ldap_group_links" | ||
| 139 | + path = f"/groups/{self.encoded_id}/ldap_group_links" | ||
| 140 | 140 | data = {"cn": cn, "group_access": group_access, "provider": provider} | |
| 141 | 141 | self.manager.gitlab.http_post(path, post_data=data, **kwargs) | |
| 142 | 142 | ||
@@ -156,7 +156,7 @@ def delete_ldap_group_link( | |||
| 156 | 156 | GitlabAuthenticationError: If authentication is not correct | |
| 157 | 157 | GitlabDeleteError: If the server cannot perform the request | |
| 158 | 158 | """ | |
| 159 | - path = f"/groups/{self.get_id()}/ldap_group_links" | ||
| 159 | + path = f"/groups/{self.encoded_id}/ldap_group_links" | ||
| 160 | 160 | if provider is not None: | |
| 161 | 161 | path += f"/{provider}" | |
| 162 | 162 | path += f"/{cn}" | |
@@ -174,7 +174,7 @@ def ldap_sync(self, **kwargs: Any) -> None: | |||
| 174 | 174 | GitlabAuthenticationError: If authentication is not correct | |
| 175 | 175 | GitlabCreateError: If the server cannot perform the request | |
| 176 | 176 | """ | |
| 177 | - path = f"/groups/{self.get_id()}/ldap_sync" | ||
| 177 | + path = f"/groups/{self.encoded_id}/ldap_sync" | ||
| 178 | 178 | self.manager.gitlab.http_post(path, **kwargs) | |
| 179 | 179 | ||
| 180 | 180 | @cli.register_custom_action("Group", ("group_id", "group_access"), ("expires_at",)) | |
@@ -200,7 +200,7 @@ def share( | |||
| 200 | 200 | Returns: | |
| 201 | 201 | Group | |
| 202 | 202 | """ | |
| 203 | - path = f"/groups/{self.get_id()}/share" | ||
| 203 | + path = f"/groups/{self.encoded_id}/share" | ||
| 204 | 204 | data = { | |
| 205 | 205 | "group_id": group_id, | |
| 206 | 206 | "group_access": group_access, | |
@@ -224,7 +224,7 @@ def unshare(self, group_id: int, **kwargs: Any) -> None: | |||
| 224 | 224 | GitlabAuthenticationError: If authentication is not correct | |
| 225 | 225 | GitlabDeleteError: If the server failed to perform the request | |
| 226 | 226 | """ | |
| 227 | - path = f"/groups/{self.get_id()}/share/{group_id}" | ||
| 227 | + path = f"/groups/{self.encoded_id}/share/{group_id}" | ||
| 228 | 228 | self.manager.gitlab.http_delete(path, **kwargs) | |
| 229 | 229 | ||
| 230 | 230 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -132,7 +132,7 @@ def move(self, to_project_id: int, **kwargs: Any) -> None: | |||
| 132 | 132 | GitlabAuthenticationError: If authentication is not correct | |
| 133 | 133 | GitlabUpdateError: If the issue could not be moved | |
| 134 | 134 | """ | |
| 135 | - path = f"{self.manager.path}/{self.get_id()}/move" | ||
| 135 | + path = f"{self.manager.path}/{self.encoded_id}/move" | ||
| 136 | 136 | data = {"to_project_id": to_project_id} | |
| 137 | 137 | server_data = self.manager.gitlab.http_post(path, post_data=data, **kwargs) | |
| 138 | 138 | if TYPE_CHECKING: | |
@@ -154,7 +154,7 @@ def related_merge_requests(self, **kwargs: Any) -> Dict[str, Any]: | |||
| 154 | 154 | Returns: | |
| 155 | 155 | The list of merge requests. | |
| 156 | 156 | """ | |
| 157 | - path = f"{self.manager.path}/{self.get_id()}/related_merge_requests" | ||
| 157 | + path = f"{self.manager.path}/{self.encoded_id}/related_merge_requests" | ||
| 158 | 158 | result = self.manager.gitlab.http_get(path, **kwargs) | |
| 159 | 159 | if TYPE_CHECKING: | |
| 160 | 160 | assert isinstance(result, dict) | |
@@ -175,7 +175,7 @@ def closed_by(self, **kwargs: Any) -> Dict[str, Any]: | |||
| 175 | 175 | Returns: | |
| 176 | 176 | The list of merge requests. | |
| 177 | 177 | """ | |
| 178 | - path = f"{self.manager.path}/{self.get_id()}/closed_by" | ||
| 178 | + path = f"{self.manager.path}/{self.encoded_id}/closed_by" | ||
| 179 | 179 | result = self.manager.gitlab.http_get(path, **kwargs) | |
| 180 | 180 | if TYPE_CHECKING: | |
| 181 | 181 | assert isinstance(result, dict) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments