fixed trying to parse more gitea payloadcommit objects where there are non (e.g. listing commits)

data is assigned to a inner_commit dictionary as commit is already taken by apiobject commit function and fixing that would cause too many things to break
pull/11/head
Langenfeld 2021-11-12 18:33:21 +01:00
rodzic e029605ded
commit 05d906148a
2 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -240,7 +240,8 @@ class Branch(GiteaApiObject):
return hash(self.commit) ^ hash(self.name)
fields_to_parsers = {
"commit": lambda gitea, c: Commit.parse_response(gitea, c)
# This is not a commit object
#"commit": lambda gitea, c: Commit.parse_response(gitea, c)
}
@classmethod
@ -561,8 +562,10 @@ class Commit(GiteaApiObject):
@classmethod
def parse_response(cls, gitea, result):
commit_cache = result["commit"]
api_object = cls(gitea)
cls._initialize(gitea, api_object, result)
BasicGiteaApiObject._add_readonly_property("inner_commit", commit_cache, api_object)
return api_object

Wyświetl plik

@ -5,7 +5,7 @@ with open('README.md') as readme_file:
setup_args = dict(
name='py-gitea',
version='0.1.7',
version='0.1.8',
description='A python wrapper for the Gitea API',
long_description_content_type="text/markdown",
long_description=README,