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
8398c0b8
Commit
8398c0b8
authored
Mar 19, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slider
parent
e22947fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
middleware.py
catalog/middleware.py
+9
-1
show_cart.html
catalog/templates/show_cart.html
+8
-0
views.py
catalog/views.py
+4
-2
No files found.
catalog/middleware.py
View file @
8398c0b8
...
...
@@ -16,9 +16,17 @@ class AuthRequiredMiddleware(object):
# if request.path_info == reverse('ws-news-list2'):
# return response
if
not
request
.
user
.
is_authenticated
and
request
.
path_info
!=
reverse
(
'login'
)
and
not
request
.
user
.
is_active
:
if
request
.
path_info
==
reverse
(
'ipn'
):
print
(
request
.
path_info
)
elif
not
request
.
user
.
is_authenticated
and
request
.
path_info
!=
reverse
(
'login'
)
and
not
request
.
user
.
is_active
:
return
HttpResponseRedirect
(
reverse
(
'login'
))
#if not request.user.is_authenticated and request.path_info != reverse('login') and not request.user.is_active:
#if not request.user.is_authenticated or not request.user.is_active:
# return HttpResponseRedirect(reverse('login'))
# Code to be executed for each request/response after
# the view is called.
...
...
catalog/templates/show_cart.html
View file @
8398c0b8
...
...
@@ -237,7 +237,15 @@
height=
"1"
>
</form>
<form
method=
"post"
action=
"http://repsat.geoint.mx/catalog/ipn/"
>
<input
type=
"text"
name=
"nombre"
value=
""
>
<input
type=
"submit"
>
</form>
<form
method=
"post"
action=
"../ipn/"
>
<input
type=
"text"
name=
"nombre"
value=
""
>
<input
type=
"submit"
>
</form>
</td>
...
...
catalog/views.py
View file @
8398c0b8
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.shortcuts
import
render
,
redirect
from
django.views.decorators.csrf
import
csrf_exempt
from
GeoInt_SIDT.settings
import
BASE_URL
from
catalog.forms
import
ASFSearchForm
...
...
@@ -569,7 +570,7 @@ def Pay(request):
# ~ prod_list.append({
# ~ 'purchased': products['purchased'],
# ~ 'price' : products['price'],
# ~ 'aggreg_date' : products['aggreg_date'],
# ~ 'aggreg_date' : products['aggreg_date'],
# ~ 'catalog': product
# ~ })
# ~ return JsonResponse({'product_list': prod_list})
...
...
@@ -581,6 +582,7 @@ def Pay(request):
# -----------------------------------------------------------------
@
csrf_exempt
def
IPN
(
request
):
PATH_USERS
=
config
[
'PATHS'
][
'PATH_USERS'
]
print
()
...
...
@@ -588,7 +590,7 @@ def IPN(request):
x
=
request
.
POST
.
dict
()
for
key
,
value
in
x
.
items
():
f
.
write
(
key
+
": "
+
value
+
'
\n
'
)
return
HttpResponse
(
"hola"
)
return
redirect
(
'../../'
)
#print("content-type: text/html\r\n\r\n")
#if request.POST.get['payment_status'] == 'Completed':
...
...
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