Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoInt_SIDT
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoInt_SIDT
Commits
48960e3b
Commit
48960e3b
authored
Jan 25, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
importacion depreciada, actualizada
parent
9e8f9db8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
middleware.py
catalog/middleware.py
+4
-3
No files found.
catalog/middleware.py
View file @
48960e3b
from
django.shortcuts
import
HttpResponseRedirect
from
django.shortcuts
import
HttpResponseRedirect
from
django.core.urlresolvers
import
reverse
#from django.core.urlresolvers import reverse
from
django.urls
import
reverse
class
AuthRequiredMiddleware
(
object
):
class
AuthRequiredMiddleware
(
object
):
def
__init__
(
self
,
get_response
):
def
__init__
(
self
,
get_response
):
...
@@ -16,8 +17,8 @@ class AuthRequiredMiddleware(object):
...
@@ -16,8 +17,8 @@ class AuthRequiredMiddleware(object):
# if request.path_info == reverse('ws-news-list2'):
# if request.path_info == reverse('ws-news-list2'):
# return response
# return response
if
not
request
.
user
.
is_authenticated
()
and
request
.
path_info
!=
reverse
(
'login'
):
#
if not request.user.is_authenticated() and request.path_info != reverse('login'):
return
HttpResponseRedirect
(
reverse
(
'login'
))
#
return HttpResponseRedirect(reverse('login'))
# Code to be executed for each request/response after
# Code to be executed for each request/response after
# the view is called.
# the view is called.
...
...
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