Skip to content

Commit

Permalink
fix: [website] misp-objects submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidCruciani committed Feb 26, 2024
1 parent a2721c9 commit e737605
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@
path = misp_modules/lib/misp-objects
url = https://github.com/MISP/misp-objects.git
branch = main
[submodule "website/data/misp-objects"]
path = website/data/misp-objects
url = https://github.com/MISP/misp-objects
5 changes: 4 additions & 1 deletion website/app/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import requests
# import jsonschema
from config import Config
from pathlib import Path

MODULES = []

Expand Down Expand Up @@ -39,7 +40,9 @@ def isUUID(uid):
return False

def get_object(obj_name):
loc_path = os.path.join(os.getcwd(), "data", "misp-objects", "objects")
path = Path(os.getcwd())
parent_path = path.parent.absolute()
loc_path = os.path.join(parent_path, "misp_modules", "lib", "misp-objects", "objects")
if os.path.isdir(loc_path):
with open(os.path.join(loc_path, obj_name, "definition.json"), "r") as read_json:
loc_json = json.load(read_json)
Expand Down

0 comments on commit e737605

Please sign in to comment.