From d4b0505105ddbf751176f5990d4998fbaf574b4c Mon Sep 17 00:00:00 2001 From: jeremyrp Date: Tue, 22 Dec 2015 16:36:04 -0500 Subject: [PATCH 1/2] Revised modules and test that successfully runs --- cred/models.py | 8 ++++---- ratticweb/context_processors.py | 4 ++-- ratticweb/tests/test_storage.py | 2 +- requirements-base.txt | 7 ++++--- requirements-dev.txt | 2 +- requirements-pip.txt | 2 ++ runtests.sh | 2 +- 7 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 requirements-pip.txt diff --git a/cred/models.py b/cred/models.py index 9baa6309..6fb2fc2e 100644 --- a/cred/models.py +++ b/cred/models.py @@ -38,10 +38,10 @@ def visible(self, user, historical=False, deleted=False): if not historical: qs = qs.filter(latest=None) - qs = qs.filter(Q(group__in=usergroups) - | Q(latest__group__in=usergroups) - | Q(groups__in=usergroups) - | Q(latest__groups__in=usergroups)).distinct() + qs = qs.filter(Q(group__in=usergroups) | + Q(latest__group__in=usergroups) | + Q(groups__in=usergroups) | + Q(latest__groups__in=usergroups)).distinct() return qs diff --git a/ratticweb/context_processors.py b/ratticweb/context_processors.py index 3a07595a..92889be7 100644 --- a/ratticweb/context_processors.py +++ b/ratticweb/context_processors.py @@ -11,8 +11,8 @@ def base_template_reqs(request): 'USE_LDAP_GROUPS': settings.USE_LDAP_GROUPS, 'EXPORT_ENABLED': not settings.RATTIC_DISABLE_EXPORT, 'TEMPLATE_DEBUG': settings.TEMPLATE_DEBUG, - 'ALLOWPWCHANGE': not (settings.LDAP_ENABLED - and not settings.AUTH_LDAP_ALLOW_PASSWORD_CHANGE), + 'ALLOWPWCHANGE': not (settings.LDAP_ENABLED and + not settings.AUTH_LDAP_ALLOW_PASSWORD_CHANGE), 'rattic_icon': 'rattic/img/rattic_icon_normal.png', 'rattic_logo': 'rattic/img/rattic_logo_normal.svg', } diff --git a/ratticweb/tests/test_storage.py b/ratticweb/tests/test_storage.py index 83ead540..96a93525 100644 --- a/ratticweb/tests/test_storage.py +++ b/ratticweb/tests/test_storage.py @@ -31,7 +31,7 @@ def test_validates_on_enter(self): with mock.patch.object(self.storage, "validate_destination", validate_destination): with self.storage as storage: self.assertIs(storage, self.storage) - self.storage.validate_destination.assert_called_once() + self.storage.validate_destination.assert_called_once_with() @mock.patch("ratticweb.management.commands.storage.S3Connection") def test_doesnt_connect_to_s3_if_no_BACKUP_S3_BUCKET_setting(self, FakeS3Connection): diff --git a/requirements-base.txt b/requirements-base.txt index c95e8599..d44121da 100644 --- a/requirements-base.txt +++ b/requirements-base.txt @@ -14,15 +14,16 @@ pycrypto>=2.6,<2.7 python-dateutil>=2.1,<2.2 python-ldap>=2.4,<2.5 python-mimeparse==0.1.4 -six>=1.6,<1.7 +six==1.10.0 urldecode==0.1 wsgiref==0.1.2 keepassdb==0.2.1 db_backup==0.1.3 -boto==2.26.1 +boto==2.38.0 lxml==3.3.3 celery>=3.1,<3.2 -django-celery>=3.1,<3.2 +django-celery>=3.1,<3.1.17 importlib django-social-auth>=0.7.9 paramiko==1.15.2 +kombu==3.0.26 diff --git a/requirements-dev.txt b/requirements-dev.txt index 2fd79cc1..13499159 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,6 +4,6 @@ nose django_nose nose-testconfig selenium -pep8==1.5.0 +pep8==1.6.2 pyflakes diff --git a/requirements-pip.txt b/requirements-pip.txt new file mode 100644 index 00000000..3d80035d --- /dev/null +++ b/requirements-pip.txt @@ -0,0 +1,2 @@ +pip>=1.5.4 +setuptools>=17.1 diff --git a/runtests.sh b/runtests.sh index ad3f3148..7196ab86 100755 --- a/runtests.sh +++ b/runtests.sh @@ -51,7 +51,7 @@ function runtest() { } if (( $tests_only == 0 )); then - runtest "PEP8" "pep8 --exclude=migrations,lib,static,.ropeproject --ignore=E501,E225,E128,E124 ." + runtest "PEP8" "pep8 --exclude=migrations,lib,static,.ropeproject --ignore=E501,E225,E128,E124,E402 ." runtest "pyflakes" "./pyflakes.sh" fi From 025a2da4ce303236f78884660703f277a42bde3b Mon Sep 17 00:00:00 2001 From: jeremyrp Date: Wed, 30 Dec 2015 10:12:24 -0500 Subject: [PATCH 2/2] Add button to open URL in new window --- cred/templates/cred_detail.html | 3 ++- ratticweb/static/rattic/css/base.css | 7 +++++-- .../static/rattic/img/icon_open_in_new_window.png | Bin 0 -> 270 bytes 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 ratticweb/static/rattic/img/icon_open_in_new_window.png diff --git a/cred/templates/cred_detail.html b/cred/templates/cred_detail.html index ba2913a4..f2e22c51 100644 --- a/cred/templates/cred_detail.html +++ b/cred/templates/cred_detail.html @@ -3,6 +3,7 @@ {% load i18n %} {% load cred_markdown %} {% load credicons %} +{% load static from staticfiles %} {% block title %}{{ cred.title }} - {% trans "Rattic" %}{% endblock %} @@ -39,7 +40,7 @@

{% cred_icon cred.iconname %} {{ cred.title }}

{% endif %} -{% if cred.url %}{% endif %} +{% if cred.url %}{% endif %}
{% trans "URL" %}{{ cred.url }}
{% trans "URL" %}{{ cred.url }}
{% trans "Username" %} diff --git a/ratticweb/static/rattic/css/base.css b/ratticweb/static/rattic/css/base.css index 355ed668..06d27c09 100644 --- a/ratticweb/static/rattic/css/base.css +++ b/ratticweb/static/rattic/css/base.css @@ -76,6 +76,11 @@ img.biglogo { width: auto; } +img.icon_open_in_new_window { + width: 16px; + height: 16px; +} + .container-fluid .credit { margin: 20px 0; } @@ -144,5 +149,3 @@ body { .table-responsive-fifth-column tbody td:nth-child(5), .table-responsive-fifth-column thead th:nth-child(5){display: none;} } - - diff --git a/ratticweb/static/rattic/img/icon_open_in_new_window.png b/ratticweb/static/rattic/img/icon_open_in_new_window.png new file mode 100644 index 0000000000000000000000000000000000000000..c093b661d044afd32eb384a4385cff967da4258d GIT binary patch literal 270 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5XHh8)?hE&{2N?0IZAhfVezJs^mgsh6&=Sqct{mhS9f3cYS zcmKv@magSs$Wha9O8o&>)Ax!T#*<%#ix@kK8M-buG6;w(>|Dawp}t@@LyCi~*x8R6 zdW;`GPmDd_q5zb-Ifr3uB!gC2;{-kryHii@IZiQ3%Hv0nI O&fw|l=d#Wzp$PzSFj*}C literal 0 HcmV?d00001