Skip to content

Refactored Hardcoded Paths - #196

Merged
Lorygold merged 2 commits into
certego:developfrom
kunalsz:hardcoded-paths
Mar 24, 2025
Merged

Refactored Hardcoded Paths#196
Lorygold merged 2 commits into
certego:developfrom
kunalsz:hardcoded-paths

Conversation

@kunalsz

@kunalsz kunalsz commented Mar 22, 2025

Copy link
Copy Markdown
Contributor

In reference to the issue #193
All the tests are getting passed normally.

@Lorygold I have made the necessary changes, and yes you were right it was settings.CERTEGO_DJANGO_PROJ_BASE_DIR not settings.BASE_DIR.

Signed-off-by: kunalsz <kunalavengers@gmail.com>
@Lorygold Lorygold linked an issue Mar 22, 2025 that may be closed by this pull request
@Lorygold
Lorygold self-requested a review March 24, 2025 08:18

@Lorygold Lorygold left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kunalsz, maybe we can reduce the memory allocation removing the DATA_PATH definition? For example inserting the path directly in the open function, such as:

with open(os.path.join(settings.CERTEGO_DJANGO_PROJ_BASE_DIR, "impossible_travel/dashboard/", name + ".json"), encoding="utf-8") as file:
    data = json.load(file)

I think it works, but it has to be tested

@kunalsz

kunalsz commented Mar 24, 2025

Copy link
Copy Markdown
Contributor Author

@Lorygold Yes this will be more efficient, I will refactor the code.

Signed-off-by: kunalsz <kunalavengers@gmail.com>
@Lorygold
Lorygold merged commit 0c5d13d into certego:develop Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hardcoded paths in multiple files

2 participants