Skip to content

Commit

Permalink
Snipe bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tnurse18 committed Apr 9, 2021
1 parent 4b88be1 commit 846ba14
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions inventory/views.py
Expand Up @@ -400,6 +400,8 @@ def snipe_checkout(request):
checkout_to_choices = []
response = requests.request('GET', '{}api/v1/users'.format(settings.SNIPE_URL), headers={
'authorization': 'Bearer {}'.format(settings.SNIPE_API_KEY),
'accept': 'application/json',
'content-type': 'application/json'
})
if response.status_code == 200:
try:
Expand Down Expand Up @@ -428,7 +430,7 @@ def snipe_checkout(request):
# This tag represents an accessory
response = requests.request('GET', '{}api/v1/accessories/{}'.format(settings.SNIPE_URL, tag),
headers={'authorization': 'Bearer {}'.format(settings.SNIPE_API_KEY),
'accept': 'application/json'})
'accept': 'application/json', 'content-type': 'application/json'})
if response.status_code == 200:
try:
data = json.loads(response.text)
Expand Down Expand Up @@ -472,7 +474,7 @@ def snipe_checkout(request):
# This tag represents an asset
response = requests.request('GET', '{}api/v1/hardware/bytag/{}'.format(settings.SNIPE_URL, tag),
headers={'authorization': 'Bearer {}'.format(settings.SNIPE_API_KEY),
'accept': 'application/json'})
'accept': 'application/json', 'content-type': 'application/json'})
if response.status_code == 200:
try:
data = json.loads(response.text)
Expand Down Expand Up @@ -569,6 +571,8 @@ def snipe_checkin(request):
checkin_from_choices = []
response = requests.request('GET', '{}api/v1/users'.format(settings.SNIPE_URL), headers={
'authorization': 'Bearer {}'.format(settings.SNIPE_API_KEY),
'accept': 'application/json',
'content-type': 'application/json'
})
if response.status_code == 200:
try:
Expand Down Expand Up @@ -602,7 +606,7 @@ def snipe_checkin(request):
# This tag represents an accessory
response = requests.request('GET', '{}api/v1/accessories/{}'.format(settings.SNIPE_URL, tag), headers={
'authorization': 'Bearer {}'.format(settings.SNIPE_API_KEY),
'accept': 'application/json',
'accept': 'application/json', 'content-type': 'application/json'
})
if response.status_code == 200:
try:
Expand All @@ -616,7 +620,7 @@ def snipe_checkin(request):
# Get the list of checked out instances of the accessory
response = requests.request('GET', '{}api/v1/accessories/{}/checkedout'.format(settings.SNIPE_URL, tag), headers={
'authorization': 'Bearer {}'.format(settings.SNIPE_API_KEY),
'accept': 'application/json',
'accept': 'application/json', 'content-type': 'application/json'
})
if response.status_code == 200:
data = json.loads(response.text)
Expand Down Expand Up @@ -668,7 +672,7 @@ def snipe_checkin(request):
# This tag represents an asset
response = requests.request('GET', '{}api/v1/hardware/bytag/{}'.format(settings.SNIPE_URL, tag), headers={
'authorization': 'Bearer {}'.format(settings.SNIPE_API_KEY),
'accept': 'application/json',
'accept': 'application/json', 'content-type': 'application/json'
})
if response.status_code == 200:
try:
Expand Down

0 comments on commit 846ba14

Please sign in to comment.