Session Photo URL Display for Outtake_lensman

Brightcells 7 lat temu
rodzic
commit
8376944c7c
2 zmienionych plików z 5 dodań i 1 usunięć
  1. 4 0
      photo/models.py
  2. 1 1
      photo/templates/photo/session_detail.html

+ 4 - 0
photo/models.py

@@ -93,6 +93,10 @@ class PhotosInfo(BaseModelMixin):
93 93
         return qiniu_file_url(self.r_photo_path, bucket='original')
94 94
 
95 95
     @property
96
+    def session_photo_url(self):
97
+        return self.p_photo_url or self.m_photo_url
98
+
99
+    @property
96 100
     def data(self):
97 101
         return {
98 102
             'pk': self.pk,

+ 1 - 1
photo/templates/photo/session_detail.html

@@ -31,7 +31,7 @@
31 31
         <div class="container">
32 32
             <article class="text-center">
33 33
                 {% for photo in photos %}
34
-                <div><img src="{{ photo.p_photo_url }}"></div>
34
+                <div><img src="{{ photo.session_photo_url }}"></div>
35 35
                 {% endfor %}
36 36
             </article>
37 37
         </div>