Skip to content
This repository has been archived by the owner on Sep 18, 2018. It is now read-only.

Fix for Issue 347 #418

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cred/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions ratticweb/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
Expand Down
6 changes: 4 additions & 2 deletions ratticweb/static/rattic/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ div.copybutton {
display: inline;
}

button.btn-pass-fetchcred {
float:right;
}

/* Override some of the selectize defaults */
.selectize-input {
width: 220px;
Expand Down Expand Up @@ -144,5 +148,3 @@ body {
.table-responsive-fifth-column tbody td:nth-child(5),
.table-responsive-fifth-column thead th:nth-child(5){display: none;}
}


12 changes: 8 additions & 4 deletions ratticweb/static/rattic/js/newcore.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ var RATTIC = (function ($, ZeroClipboard) {
target.removeClass('passhidden');
if (target.prop('tagName') == 'INPUT') {
target.attr('type', 'text');
} else if (button.prop('className').indexOf('btn-pass-fetchcred') > -1) {
button.css('visibility','hidden');
}
}

Expand Down Expand Up @@ -329,9 +331,12 @@ var RATTIC = (function ($, ZeroClipboard) {
}

function _passfetchersync() {
var me = $(this),
cred_id = me.data('cred_id');
me.text(my.api.getCredWait(cred_id)['password']);
var me = $(this);
// Prevent show/hide of copy from causing password retrieval
if (me.prop('class').indexOf('passhidden') == -1) {
var cred_id = me.data('cred_id');
me.text(my.api.getCredWait(cred_id)['password']);
}
}

function _parentFormSubmit() {
Expand Down Expand Up @@ -779,4 +784,3 @@ $(document).ready(function () {
// Start collecting random numbers
sjcl.random.startCollectors();
});

2 changes: 1 addition & 1 deletion ratticweb/tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
7 changes: 4 additions & 3 deletions requirements-base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ nose
django_nose
nose-testconfig
selenium
pep8==1.5.0
pep8==1.6.2
pyflakes

2 changes: 2 additions & 0 deletions requirements-pip.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pip>=1.5.4
setuptools>=17.1
2 changes: 1 addition & 1 deletion runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down