Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
django-sshkey
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c4447f77
authored
Sep 15, 2014
by
Scott Duckworth
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release/2.3.2'
parents
c7cf91db
5a25a19f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
4 deletions
+34
-4
MANIFEST.in
+1
-0
RELEASE-NOTES.rst
+6
-0
django_sshkey/__init__.py
+1
-1
django_sshkey/models.py
+5
-0
django_sshkey/templates.example/sshkey/userkey_list.html
+4
-3
django_sshkey/tests.py
+17
-0
No files found.
MANIFEST.in
View file @
c4447f77
include LICENSE
include README.rst
include README.upgrading.rst
include RELEASE-NOTES.rst
include lookup.py
include lookup.sh
include django-sshkey-lookup
...
...
RELEASE-NOTES.rst
View file @
c4447f77
...
...
@@ -2,6 +2,12 @@
Release Notes for django-sshkey
===============================
2.3.2 (2014-09-15)
------------------
* Bug fix #1: entering whitespace for key field results in IndexError
* Make example templates work with Django 1.4+
2.3.1 (2014-07-29)
------------------
...
...
django_sshkey/__init__.py
View file @
c4447f77
...
...
@@ -26,4 +26,4 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
__version__
=
'2.3.
1
'
__version__
=
'2.3.
2
'
django_sshkey/models.py
View file @
c4447f77
...
...
@@ -60,8 +60,13 @@ class UserKey(models.Model):
def
clean_fields
(
self
,
exclude
=
None
):
if
not
exclude
or
'key'
not
in
exclude
:
self
.
key
=
self
.
key
.
strip
()
if
not
self
.
key
:
raise
ValidationError
({
'key'
:
[
"This field is required."
]})
def
clean
(
self
):
self
.
key
=
self
.
key
.
strip
()
if
not
self
.
key
:
return
try
:
pubkey
=
pubkey_parse
(
self
.
key
)
except
PublicKeyParseError
as
e
:
...
...
django_sshkey/templates.example/sshkey/userkey_list.html
View file @
c4447f77
{% load url from future %}
<h1>
My Keys
</h1>
{% if messages %}
<ul
class=
"messages"
>
...
...
@@ -6,7 +7,7 @@
{% endfor %}
</ul>
{% endif %}
<p><a
href=
"{% url
django_sshkey.views.userkey_add
%}"
>
Add Key
</a></p>
<p><a
href=
"{% url
"
django_sshkey
.
views
.
userkey_add
"
%}"
>
Add Key
</a></p>
<table>
<tr>
<th>
Key
</th>
...
...
@@ -29,9 +30,9 @@
<td>
{{ userkey.last_used|default:"never" }}
</td>
<td>
{% if allow_edit %}
<a
href=
"{% url
django_sshkey.views.userkey_edit
userkey.pk %}"
>
Edit
</a>
<a
href=
"{% url
"
django_sshkey
.
views
.
userkey_edit
"
userkey
.
pk
%}"
>
Edit
</a>
{% endif %}
<a
href=
"{% url
django_sshkey.views.userkey_delete
userkey.pk %}"
>
Delete
</a>
<a
href=
"{% url
"
django_sshkey
.
views
.
userkey_delete
"
userkey
.
pk
%}"
>
Delete
</a>
</td>
</tr>
{% endfor %}
...
...
django_sshkey/tests.py
View file @
c4447f77
...
...
@@ -255,6 +255,23 @@ class UserKeyCreationTestCase(BaseTestCase):
)
self
.
assertRaises
(
ValidationError
,
key2
.
full_clean
)
def
test_blank_key_fails
(
self
):
key
=
UserKey
(
user
=
self
.
user1
,
name
=
'name1'
,
key
=
''
,
)
self
.
assertRaises
(
ValidationError
,
key
.
full_clean
)
def
test_ws_key_fails
(
self
):
key
=
UserKey
(
user
=
self
.
user1
,
name
=
'name1'
,
key
=
' '
,
)
self
.
assertRaises
(
ValidationError
,
key
.
full_clean
)
class
RFC4716TestCase
(
BaseTestCase
):
@classmethod
def
setUpClass
(
cls
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment