-
-
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?
Changes from 6 commits
0c5c7e6
5fa1bb6
841a522
c46521c
95fd889
8adfcb4
249ad50
81afff7
3ce7a25
36f8b9d
a8ea4dd
d1c9b9a
f045d40
f96b428
2899b75
8350048
d712bb9
8020103
6330a19
4ec033a
b8939c5
4535e6a
a3936d6
71b6c16
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ repos: | |
rev: v0.1.13 | ||
hooks: | ||
- id: ruff | ||
args: | ||
args: | ||
- --fix | ||
- id: ruff-format | ||
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe 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. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import django.db.models.deletion | ||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("website", "0153_delete_contributorstats"), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Recommendation", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("created_at", models.DateTimeField(auto_now_add=True)), | ||
( | ||
"recommended_user", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="received_recommendations", | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
( | ||
"recommender", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="given_recommendations", | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
], | ||
), | ||
migrations.AddConstraint( | ||
model_name="recommendation", | ||
constraint=models.UniqueConstraint( | ||
fields=("recommender", "recommended_user"), name="unique_recommendation" | ||
), | ||
), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 5.1.3 on 2024-11-21 19:24 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("website", "0154_recommendation_recommendation_unique_recommendation"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="userprofile", | ||
name="recommendation_blurb", | ||
field=models.TextField(blank=True, null=True), | ||
), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 5.1.3 on 2024-11-23 07:05 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("website", "0155_userprofile_recommendation_blurb"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="userprofile", | ||
name="recommended_by", | ||
field=models.ManyToManyField( | ||
blank=True, related_name="has_recommended", to="website.userprofile" | ||
), | ||
), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,7 @@ class Meta: | |
"issue_flaged", | ||
"total_score", | ||
"activities", | ||
# "recommendations", | ||
) | ||
|
||
|
||
|
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)