Skip to content

Madeline - Pheonix class#35

Open
MBsea21 wants to merge 25 commits intoAda-C22:mainfrom
MBsea21:main
Open

Madeline - Pheonix class#35
MBsea21 wants to merge 25 commits intoAda-C22:mainfrom
MBsea21:main

Conversation

@MBsea21
Copy link

@MBsea21 MBsea21 commented Nov 8, 2024

No description provided.

MBsea21 and others added 22 commits October 31, 2024 17:41
…delete_task, test_delete_task_not_found all completed and passed.
…e_model, get_model_with_filters, added goals and goal descriptions, all of wave 5 tests have passed, added slack post api functionality to the mark complete function of tasks.
…. Currently working on getting correct response body for the final two tests in wave 6
… entering wave 7 now, will refactor later if time permits
Copy link

@anselrognlie anselrognlie left a comment

Choose a reason for hiding this comment

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

Looks good overall. Some tests were modified to account for the response approach taken, but we should leave them as is and make changes to the response approach. Please restore the tests back to their original version, and get them to pass by modifying your route logic. Review my comments, and let me know if you have any questions.

edits included:

--  fix goals to_dict/model so new keys are not added incorrectly.
-- added error handeling
-- fixed typos
-- corrected errors in wave 5 of tests to ensure project aligns with readme expectations.
-- fixed date-time issue by setting datetime to always get current utc timezone to prevent issues for users in multiple timezones.
-- fixed slack message functions so they align with slack documentation standards.
@MBsea21
Copy link
Author

MBsea21 commented Feb 18, 2025

@anselrognlie I apologize for the delay, it took a bit longer to get to as the original computer that I had vscode installed on died during capstone and I had to do install fest on my new device which took additional time. I believe I was able to address all of your concerns in the most recent update. Happy to do another pull request if you would like.

Copy link

@anselrognlie anselrognlie left a comment

Choose a reason for hiding this comment

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

👍 Your updates look good. Just a few recommendations mostly around using the utility functions.

Comment on lines +41 to +45
def check_for_completion(self):
if self.completed_at is not None:
return True
else :
return False No newline at end of file

Choose a reason for hiding this comment

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

If we're passing self, prefer this to be an actual instnce method (indent it into the class).

Nit: no space between else and :

    def check_for_completion(self):
        if self.completed_at is not None:
            return True
        else:
            return False

"id": self.id,
"title": self.title,
"description": self.description,
"is_complete": check_for_completion(self)

Choose a reason for hiding this comment

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

If check_for_completion is an instance method, call it as

            "is_complete": self.check_for_completion()

Python will shuffle things around internally.

from app.models.task import Task
from ..db import db
from datetime import datetime
from app.routes.utilities_routes import *

Choose a reason for hiding this comment

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

Prefer to explicitly list the symbols being imported rather than using import *

Comment on lines +22 to +23
goal = create_model(Goal, request_body)
return make_response(goal, 201)

Choose a reason for hiding this comment

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

With the create_model refactor, create_model is already creating an appropriate response, so we can return it as

    return create_model(Goal, request_body)

Comment on lines +55 to +56
if not goals:
return make_response([], 200)

Choose a reason for hiding this comment

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

This check is redundant. goals will alreayd be an empty list is nothing was found, so the return on line 58 willwork identically.

Comment on lines +65 to +66
except:
return make_response({"details": f"Goal {goal_id} not found"}, 404)

Choose a reason for hiding this comment

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

The try/except his unnecessary. validate_model will already take care of generating the 404 response and halting further processing of the request.

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.

2 participants