-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding user's info to the navbar #77
Conversation
90c21da
to
8272bd2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job!! looks professional 😄
just take a note of the comment I left
dc00d15
to
708328e
Compare
Hi @OfirMatasas , please update PR description with relevant changes (: |
708328e
to
56b46c7
Compare
ping |
650c0ea
to
643d7d8
Compare
ea77a1e
to
d55e838
Compare
@OfirMatasas ^^ |
After a talk with Omer, the plan is to merge the dog owner homepage before this PR, and then after rebasing the common code will be part of the master, and it will be ok. |
so don't forget to add to the description of the PR that this PR depends on #67 :) |
d4113d2
to
05ce7f4
Compare
a62e093
to
d900c53
Compare
d900c53
to
7c28d3c
Compare
dogowner/test_dog_owner.py
Outdated
dogowner_profile_image = create_dog_owner_user.get_dog_owner_profile_image_url() | ||
dog_owner_default_picture_url = "../../static/images/dog-owner-default-profile-picture.jpeg" | ||
assert dogowner_profile_image != dog_owner_default_picture_url | ||
assert dogowner_profile_image is not None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as I commented about daycare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments
7c28d3c
to
a3efce7
Compare
a3efce7
to
4f2cc47
Compare
When the user is logged into Hotails, they'll see their profile picture, and their username in every page on Hotails on the navbar. If the dog owner / daycare doesn't have any profile picture, a default one will be presented. Signed-off-by: Ofir Matasas <[email protected]> Signed-off-by: tamirmatok <[email protected]>
4f2cc47
to
b574897
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, this is nice feature!
There are some formatting and refactoring changes that makes it harder to review this PR,
please separate them to different commits /PRs before the commit that introduce the new logic.
assert daycare_profile_image != DAYCARE_DEFAULT_PICTURE_URL | ||
assert daycare_profile_image == DAYCARE_FIXTURE_PROFILE_PICTURE_URL_1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its enough to assert on DAYCARE_FIXTURE_PROFILE_PICTURE_URL_1
|
||
def get_dog_owner_profile_image_url(self): | ||
return self.dog_picture_url if self.dog_picture_url else DOG_OWNER_DEFAULT_PROFILE_PICTURE_URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why isnt this logic part of create()?
list_of_daycares_from_response = list(response.context['daycares']) | ||
list_of_all_daycares = list(DayCare.objects.all()) | ||
assert list_of_daycares_from_response == list_of_all_daycares |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not related to the scope of this PR, right?
dog_owner_picture_url = create_dog_owner_user.dog_picture_url | ||
assert response.context['navbar_picture_url'] == dog_owner_picture_url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would pass variables substitutions in cases like this, and assert the actual value directly instead:
assert response.context['navbar_picture_url'] == create_dog_owner_user.dog_picture_url
Also, it would make the test look nicer if the assert
line would be separated with new line from the test setup logic.
from dogowner.models import DogOwner | ||
|
||
|
||
def navbar_extras(request): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it necessary to filler out the authenticated user from the models?
Is it possible to use the logged in user in this context?
@@ -8,6 +8,11 @@ | |||
from review.models import Review | |||
|
|||
|
|||
DOG_OWNER_FIXTURE_PROFILE_PICTURE_URL = "https://www.akc.org/wp-content/uploads/2019/06/Bohemian-Shepherd.1.jpg" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this change (and similar changes) to their own commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR has room to improve, and Or's comments should've been addressed.
however it is good enough, and I won't want this work to not be shown at the last demo, therefore I am merging it.
If you will continue to work on this project later, please address the comments.
Desired Outcome
Every user on Hotails will have his profile picture and their nickname on the navbar, following to every page on Hotails.
Implemented Changes
The base_template has changed, that only when a user is logged into Hotails, they'll see this information.
Connected Issue/Story
Closes #76
Definition of Done
Test Coverage
This PR includes new unit and integration tests to go with the code
A Picture of The New Navbar