Skip to content

Commit

Permalink
Fixed data field.
Browse files Browse the repository at this point in the history
  • Loading branch information
Knucklessg1 committed May 30, 2024
1 parent 5ef7fef commit 73691e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions gitlab_api/gitlab_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3596,7 +3596,6 @@ class Pipeline(BaseModel):
detailed_status: Optional[DetailedStatus] = Field(
default=None, description="The detailed status of the pipeline."
)
message: Optional[str] = Field(default=None, description="Any error messages")


class Pipelines(BaseModel):
Expand Down Expand Up @@ -3682,7 +3681,6 @@ class Package(BaseModel):
file_sha256: Optional[str] = Field(
default=None, description="SHA-256 checksum of the package file"
)
message: Optional[str] = Field(default=None, description="Any error messages")


class Packages(BaseModel):
Expand Down Expand Up @@ -4103,7 +4101,6 @@ class Project(BaseModel):
forked_from_project: Optional[Dict] = Field(
default=None, description="The project from where this project was forked from."
)
message: Optional[str] = Field(default=None, description="Any error messages")
mr_default_target_self: Optional[bool] = Field(
default=None,
description="Merge Request default target self.",
Expand Down Expand Up @@ -4579,7 +4576,6 @@ class Group(BaseModel):
created_at: Optional[str] = Field(
default=None, description="Creation timestamp of the group"
)
message: Optional[str] = Field(default=None, description="Any error messages")
statistics: Optional[Statistics] = Field(
default=None, description="Statistics of the group"
)
Expand Down Expand Up @@ -4633,7 +4629,9 @@ class Group(BaseModel):
)
ldap_cn: Optional[Any] = Field(default=None, description="LDAP CN information")
ldap_access: Optional[Any] = Field(default=None, description="LDAP Access")
prevent_forking_outside_group: Optional[bool] = Field(default=None, description="Forking disabled outside group")
prevent_forking_outside_group: Optional[bool] = Field(
default=None, description="Forking disabled outside group"
)


class Groups(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion gitlab_api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def process_response(response: requests.Response) -> Union[Response, requests.Re
logging.error(f"JSON Conversion Error: {response_error}")
try:
response = Response(
**response,
data=response,
status_code=status_code,
raw_output=raw_output,
json_output=response,
Expand Down
2 changes: 1 addition & 1 deletion test/test_gitlab_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ def test_project_response_1():
"allow_pipeline_trigger_approve_deployment": True,
"mr_default_target_self": True,
"forked_from_project": {},
"message": "failure",
"container_expiration_policy": {
"cadence": "1month",
"enabled": True,
Expand Down Expand Up @@ -568,6 +567,7 @@ def test_project_response_1():
},
]
response = Response(data=example_data, status_code=200, json_output=example_data)
assert response.base_type == "Projects"
assert response.data.base_type == "Projects"


Expand Down

0 comments on commit 73691e2

Please sign in to comment.