Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sakshi Agrawal
gkcore
Commits
799e1898
Commit
799e1898
authored
Nov 08, 2017
by
Krishnakant Mane
Committed by
Reshma Atmaram Bhatawadekar
Nov 09, 2017
Browse files
Added function to only return state gstin for an organisation.
parent
62ffcbbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
gkcore/views/api_organisation.py
View file @
799e1898
...
...
@@ -465,11 +465,22 @@ class api_organisation(object):
except
:
self
.
con
.
close
()
return
{
"gkstatus"
:
enumdict
[
"ConnectionFailed"
]}
@
view_config
(
request_method
=
"GET"
,
renderer
=
"json"
,
request_param
=
"osg=true"
)
def
getOrgStateGstin
(
self
):
token
=
self
.
request
.
headers
[
'gktoken'
]
authDetails
=
authCheck
(
token
)
if
authDetails
[
"auth"
]
==
False
:
return
{
"gkstatus"
:
enumdict
[
"UnauthorisedAccess"
]}
else
:
try
:
self
.
con
=
eng
.
connect
()
gstinResult
=
self
.
con
.
execute
(
"select gstin ->>'%s' as stgstin from organisation where orgcode = %d and statecode = %d"
%
(
authDetails
[
"orgcode"
],
self
.
request
.
params
[
"statecode"
]
)
)
gstinrow
=
gstinResult
.
fetchone
()
return
{
"gkstatus"
:
enumdict
[
"Succes"
],
"gkresult"
:
str
(
gstinrow
[
"stgstin"
])}
except
:
return
{
"gkstatus"
:
enumdict
[
"ConnectionFailed"
]}
@
view_config
(
request_method
=
'PUT'
,
renderer
=
'json'
)
def
putOrg
(
self
):
token
=
self
.
request
.
headers
[
'gktoken'
]
...
...
Write
Preview
Supports
Markdown
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