Просмотр исходного кода

Fix short hash not being output to API

ghorsington 3 лет назад
Родитель
Сommit
995ba71eb7
2 измененных файлов с 2 добавлено и 1 удалено
  1. 1 0
      src/app.py
  2. 1 1
      src/templates/project_view.html

+ 1 - 0
src/app.py

@@ -21,6 +21,7 @@ class Artifact(DataClassJsonMixin):
     changelog: str
     artifacts: List[ArtifactItem]
     hash: str = None
+    short_hash: str = None
 
 
 @dataclass

+ 1 - 1
src/templates/project_view.html

@@ -27,7 +27,7 @@
     <div class="artifact-details">
         <span class="artifact-id">#{{artifact.id}}</span>
         {%-if artifact.hash%}
-        <a class="hash-button" href="{{selected_project.info.commit_url}}/{{artifact.hash}}">{{artifact.hash[:8]}}</a>
+        <a class="hash-button" href="{{selected_project.info.commit_url}}/{{artifact.hash}}">{{artifact.short_hash or artifact.hash[:8]}}</a>
         {%-endif%}
         <span class="build-date-text">Build date: <span class="build-date">{{artifact.date}}</span></span>
         <span class="icon-downup icon-down-open"></span>