Added a custom context processor (to pass in the context required for the sidebar...
[~kgodey/maayanwich.git] / templates / allsandwiches.html
index 4877263..24f15b7 100644 (file)
@@ -5,7 +5,9 @@
                {% for s in allsandwiches %}
                        <h3 class="sandwichtitle">{{ s.adjective }}</h3>
                        <p class="metadata">Made on {{ s.date_made }} and added by {{ s.user.username }}.</p>
-                       <img class="sandwichimg" src="{{ s.picture.url }}">
+                       {% if s.picture %}
+                               <img class="sandwichimg" src="{{ s.picture.url }}">
+                       {% endif %}
                        <h4 class="sandwichsub">Ingredients</h4>
                        <ul class="ingredients">
                                {% for i in s.ingredients.all %}