Repository: packit/packit-service
Issue: 500 Internal Server Error on /api/copr-builds/<id> endpoint

I'm getting 500 internal error while trying to get build details using the `/api/copr-builds/<build-id>` endpoint on my local system with the latest master branch.

Here is the `packit-service` container logs:
```
[Sun Apr 12 06:01:57.965962 2020] [wsgi:error] [pid 242:tid 140407945242368] [client 172.18.0.1:35726]   File "/usr/local/lib/python3.7/site-packages/packit_service/service/api/copr_builds.py", line 112, in get
[Sun Apr 12 06:01:57.965964 2020] [wsgi:error] [pid 242:tid 140407945242368] [client 172.18.0.1:35726]     "repo_name": build.pr.project.repo_name,
[Sun Apr 12 06:01:57.965980 2020] [wsgi:error] [pid 242:tid 140407945242368] [client 172.18.0.1:35726] AttributeError: 'CoprBuildModel' object has no attribute 'pr'
172.18.0.1 - - [12/Apr/2020:06:01:56 +0000] "GET /api/copr-builds/1334957 HTTP/1.1" 500 538
``` 

@lachmanfrantisek I think the db fixes done in #529 in the `packit_service/service/api/copr_builds.py` file in the `CoprBuildsList` class, also needs to be replicated for the `InstallationItem` class. 

Changed files:
packit_service/service/api/copr_builds.py

diff --git a/packit_service/service/api/copr_builds.py b/packit_service/service/api/copr_builds.py
index ce6e50f3..14e355c6 100644
--- a/packit_service/service/api/copr_builds.py
+++ b/packit_service/service/api/copr_builds.py
@@ -106,27 +106,29 @@ class InstallationItem(Resource):
         builds_list = CoprBuildModel.get_all_by_build_id(str(id))
         if bool(builds_list.first()):
             build = builds_list[0]
+            project = build.get_project()
+            pr = project.pull_requests[0]
             build_dict = {
                 "project": build.project_name,
                 "owner": build.owner,
-                "repo_name": build.pr.project.repo_name,
+                "repo_name": pr.project.repo_name,
                 "build_id": build.build_id,
                 "status": build.status,
                 "chroots": [],
                 "build_submitted_time": optional_time(build.build_submitted_time),
                 "build_start_time": build.build_start_time,
                 "build_finished_time": build.build_finished_time,
-                "pr_id": build.pr.pr_id,
+                "pr_id": pr.pr_id,
                 "commit_sha": build.commit_sha,
-                "repo_namespace": build.pr.project.namespace,
+                "repo_namespace": pr.project.namespace,
                 "web_url": build.web_url,
                 "srpm_logs": build.srpm_build.logs,
-                "git_repo": f"https://github.com/{build.pr.project.namespace}/"
-                f"{build.pr.project.repo_name}",
+                "git_repo": f"https://github.com/{pr.project.namespace}/"
+                f"{pr.project.repo_name}",
                 # For backwards compatability with the old redis based API
                 "ref": build.commit_sha,
-                "https_url": f"https://github.com/{build.pr.project.namespace}/"
-                f"{build.pr.project.repo_name}.git",
+                "https_url": f"https://github.com/{pr.project.namespace}/"
+                f"{pr.project.repo_name}.git",
             }
             # merge chroots into one
             for sbid_build in builds_list: