-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
Added Feature to recommend Users from profile page #2948
base: main
Are you sure you want to change the base?
Conversation
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: website/views/user.py
Did you find this useful? React with a 👍 or 👎 |
This looks good can you please also add a text area where the user can add a recommendation blurb and if there is a blurb then show it on the profile on the bottom of the page otherwise, having the number count is good. |
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 see the comment for the changes requested and also please make sure the tests are passing
if blurb: | ||
# Remove any HTML or template tags | ||
blurb = re.sub(r"<[^>]+>", "", blurb) | ||
blurb = re.sub(r"{%.*?%}", "", blurb) |
Check failure
Code scanning / CodeQL
Polynomial regular expression used on uncontrolled data
# Remove any HTML or template tags | ||
blurb = re.sub(r"<[^>]+>", "", blurb) | ||
blurb = re.sub(r"{%.*?%}", "", blurb) | ||
blurb = re.sub(r"{{.*?}}", "", blurb) |
Check failure
Code scanning / CodeQL
Polynomial regular expression used on uncontrolled data
website/views/user.py
Outdated
|
||
|
||
# Add new view for AJAX blurb recommendations | ||
@require_POST |
Check warning
Code scanning / CodeQL
URL redirection from remote source
website/views/user.py
Outdated
|
||
|
||
@login_required | ||
def ajax_recommend_user(request, username): |
Check warning
Code scanning / CodeQL
URL redirection from remote source
@DonnieBLT Added a recommendation blurb which can be added to a User's Profile from Edit Profile Page. Screen.Recording.2024-11-23.at.4.53.53.PM.mov |
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 see comments
@@ -625,6 +628,9 @@ | |||
path("time-logs/", TimeLogListView, name="time_logs"), | |||
path("sizzle-daily-log/", sizzle_daily_log, name="sizzle_daily_log"), | |||
path("blog/", include("blog.urls")), | |||
path("recommend/<int:user_id>/", recommend_user, name="recommend_user"), |
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.
can you be consistent and use either user id or username - and do we need 3 more urls? Can we do this all with one more?
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.
each of the 3 urls determine, recommend users manually(using the dedicated recommendation feature on user profile) , recommend directly from the button under the recommendation blurb and another is ajax recommendation(this was optional and can be removed)
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.
there are a few changes to make also did you ever get permission from @npxpatel to use his code?
website/admin.py
Outdated
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 missing imports
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.
umm, can you please tell me which imports are missing from this file? I apologise if I missed any
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.
you can check the original here it has the missing import - https://github.com/OWASP-BLT/BLT/pull/2656/files - did you test this code? This would have thrown an error.
code was originally from here #2656 |
I did ask him but he never replied |
Actually, I created this project solely to develop a badge for BLT repository which can be used in the README.md file(#2940) and never intended on using it anywhere else. I was going to archive the repository and delete the badge as soon as the corresponding PR for the issue was merged, I waited so just in case the badge I created could come in-use. |
@DonnieBLT please review the changes I've made to execute the recommendation system and recommendation blurb. Screen.Recording.2024-12-03.at.10.28.50.PM.mov |
@DonnieBLT Sir, can you please review the changes I've made and suggest any probable changes, thank you! |
this should be liked LinkedIn where you can recommend a user like "this person is a good developer, I recommend them" and it shows the date and image and name of user who recommended them. |
The current implementation displays the avatar and the name of the person who has recommended the author, as a list in |
@DonnieBLT sir, can you please review the changes I've made in the latest commit.
Screen.Recording.2024-12-20.at.7.43.25.PM.mov |
When you recommend a user, you should be able to insert text |
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.
Can you please clean this up and remove the unnecessary files and changes check the conflict
|
@DonnieBLT Sir I've made the required corrections and resolved the conflicts, Can you please review the changes? Screen.Recording.2024-12-26.at.6.14.38.PM.mov |
@DonnieBLT sir can you please review the conflicts and resolve them? |
Users can recommend other uses directly from their profile page. I've also added a badge which shows the recommended users.
Closes: #2632
Screen.Recording.2024-11-19.at.2.08.44.AM.mov