Skip to contentSkip to conversation

Fixes for some recent changes

PATCH New Paul Eggleton 1 participant 4 messages May 4, 2018

lore
Share & tools
lore
#0 lore raw

cover Fixes for some recent changes

Fix a few regressions I recently introduced.

The following changes since commit b4cfb049d9fda7fe82f97f8532abdb7272cf0a76:

requirements.txt: bump Django and other dependency versions (2018-05-01 10:10:21 +1200)

are available in the Git repository at:

git://git.yoctoproject.org/layerindex-web paule/fixes1
http://git.yoctoproject.org/cgit.cgi//log/?h=paule/fixes1

Paul Eggleton (3):
views: fix regression in publish email sending code requirements.txt: fix some conflicting requirements
detail: Fix layer description not wrapping properly

 layerindex/views.py              | 9 ++++-----
 requirements.txt                 | 6 +++---
 templates/layerindex/detail.html | 2 +-
 3 files changed, 8 insertions(+), 9 deletions(-)
Signature · 1 line
2.14.3
#1 lore raw

PATCH 1/3 views: fix regression in publish email sending code

In e902b67bccddf34d8bbd65ad6c81d078e945ebb8 I missed a couple of Context usages in the layer publish view and the result was that it broke publishing a layer (and apparently I didn't run a final test on that, shame on me).

Thanks to Yi Zhao <[email protected]> for pointing this out.

---
 layerindex/views.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
layerindex/views.py +4 -5
index c84982ae..bc3cddfa 100644
@@ -20,7 +20,6 @@ from django.db import transaction
 from django.contrib.auth.models import User, Permission
 from django.db.models import Q, Count, Sum
 from django.template.loader import get_template
-from django.template import Context
 from django.utils.decorators import method_decorator
 from django.contrib.auth.decorators import login_required
 from django.contrib import messages
@@ -277,19 +276,19 @@ def publish_view(request, name):
             break
 
     # create subject from subject template
-    d = Context({
+    d = {
         'layer_name': layeritem.name,
         'site_name': request.META['HTTP_HOST'],
-    })
+    }
     subject = subjecttext.render(d).rstrip()
 
     #create body from body template
-    d = Context({
+    d = {
         'maintainers': maintainer_names,
         'layer_name': layeritem.name,
         'layer_url': layer_url,
         'help_contact': help_contact,
-    })
+    }
     body = bodytext.render(d)
 
     tasks.send_email.apply_async((subject, body, from_email, [m.email for m in maintainers]))
Signature · 1 line
2.14.3
#2 lore raw

PATCH 2/3 requirements.txt: fix some conflicting requirements

In reply to Paul Eggleton

pip (strangely only in the python 2 version when I test it here) reports that some of the versions in requirements.txt were incompatible:

django-nvd3 0.9.7 has requirement python-nvd3==0.14.2, but you'll have python-nvd3 0.15.0 which is incompatible. django-registration 2.4.1 has requirement confusable-homoglyphs~=3.0, but you'll have confusable-homoglyphs 2.0.2 which is incompatible. python-nvd3 0.14.2 has requirement python-slugify==1.1.4, but you'll have python-slugify 1.2.5 which is incompatible.

I'm not particularly keen on downgrading these but it seems like we don't have much choice. Luckily looking over the changelogs it doesn't seem like that will cause us any problems though.

Thanks to Yi Zhao <[email protected]> for pointing this out.

---
 requirements.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
requirements.txt +3 -3
index 604c653e..5ca7cf6e 100644
@@ -2,7 +2,7 @@ amqp==2.2.2
 anyjson==0.3.3
 billiard==3.5.0.3
 celery==4.1.0
-confusable-homoglyphs==2.0.2
+confusable-homoglyphs==3.0.0
 Django>1.11.0,<1.12
 django-cors-headers==1.1.0
 django-nvd3==0.9.7
@@ -19,8 +19,8 @@ kombu==4.1.0
 MarkupSafe==1.0
 mysqlclient==1.3.12
 Pillow==5.1.0
-python-nvd3==0.15.0
-python-slugify==1.2.5
+python-nvd3==0.14.2
+python-slugify==1.1.4
 pytz==2018.4
 six==1.11.0
 smmap==0.9.0
Signature · 1 line
2.14.3
#3 lore raw

PATCH 3/3 detail: Fix layer description not wrapping properly

In reply to Paul Eggleton

In 3adddf6a25977cb576f8fcefd307d947e43d637b I changed the style to allow pre-formatted text to work in the layer description, but this broke wrapping so that text could go behind the "Dependencies" box. Use the "pre-wrap" style instead so that both pre-formatting and wrapping work here.

---
 templates/layerindex/detail.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
templates/layerindex/detail.html +1 -1
index d1e807be..220d475b 100644
@@ -76,7 +76,7 @@
 
             <div class="row-fluid">
                 <div class="description span7">
-                    <p style="white-space: pre">{{ layeritem.description }}</p>
+                    <p style="white-space: pre-wrap">{{ layeritem.description }}</p>
                     <p>
                         {% if layeritem.usage_url %}
                             <span class="label label-info">
Signature · 1 line
2.14.3