Skip to content

Commit

Permalink
Merge branch 'release/1.5.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Nov 16, 2018
2 parents 135d30c + 92bc890 commit 35762bb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -2,7 +2,7 @@
.cache/
.idea/
.vscode/
venv/
venv*/
tmp/
*.pyc
thehive4py/*.pyc
Expand Down
6 changes: 3 additions & 3 deletions samples/test-case-update.py
Expand Up @@ -7,7 +7,7 @@
api = TheHiveApi('http://127.0.0.1:9000', '**YOUR_API_KEY**')

# Create a new case
case = thehive.case.create(title='From TheHive4Py', description='N/A', tlp=3, flag=True,
case = api.case.create(title='From TheHive4Py', description='N/A', tlp=3, flag=True,
tags=['TheHive4Py', 'sample'], tasks=[])

# Save the new case's ID for later use
Expand All @@ -19,8 +19,8 @@
case.flag = False

# Update the case
thehive.update_case(case)
api.update_case(case)

# Retrieve the case from the server and check the updated values
new_case = thehive.case(case_id)
new_case = api.case(case_id)
print("Case ID {}\nTLP: {}, Severity: {}".format(new_case.id, new_case.tlp, new_case.severity))
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -11,7 +11,7 @@

setup(
name='thehive4py',
version='1.5.2',
version='1.5.3',
description='Python API client for TheHive.',
long_description=read_md('README.md'),
author='TheHive-Project',
Expand Down
2 changes: 1 addition & 1 deletion thehive4py/api.py
Expand Up @@ -114,7 +114,7 @@ def update_case(self, case, fields=[]):

# Choose which attributes to send
update_keys = [
'title', 'description', 'severity', 'startDate', 'owner', 'flag', 'tlp', 'tags', 'resolutionStatus',
'title', 'description', 'severity', 'startDate', 'owner', 'flag', 'tlp', 'tags', 'status', 'resolutionStatus',
'impactStatus', 'summary', 'endDate', 'metrics', 'customFields'
]
data = {k: v for k, v in case.__dict__.items() if (len(fields) > 0 and k in fields) or (len(fields) == 0 and k in update_keys)}
Expand Down

0 comments on commit 35762bb

Please sign in to comment.