Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bryan BRANCOTTE
django-basetheme-bootstrap
Commits
1f17688c
Commit
1f17688c
authored
May 20, 2019
by
Bryan BRANCOTTE
Browse files
Account page should only be accessed when logged in
parent
d8b38911
Changes
2
Hide whitespace changes
Inline
Side-by-side
basetheme_bootstrap/tests.py
View file @
1f17688c
...
...
@@ -16,6 +16,15 @@ class AboutPageTests(TestCase):
self
.
assertEqual
(
response
.
status_code
,
200
)
class
AccountPageTests
(
TestCase
):
def
test_works
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'basetheme_bootstrap:account'
))
self
.
assertRedirects
(
response
,
expected_url
=
reverse
(
'basetheme_bootstrap:login'
)
+
"?next="
+
reverse
(
'basetheme_bootstrap:account'
),
)
class
SignUpTests
(
TestCase
):
def
setUp
(
self
):
...
...
basetheme_bootstrap/views.py
View file @
1f17688c
...
...
@@ -134,6 +134,7 @@ def user_delete(request):
})
@
login_required
def
account_detail
(
request
):
klass
=
user_preferences
.
get_user_preference_class
()
if
klass
is
None
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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