Skip to content
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

like and flag fix #1658

Merged
merged 7 commits into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions website/alternative_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ def flag_issue2(request, issue_pk):
issue_pk = int(issue_pk)
issue = Issue.objects.get(pk=issue_pk)
userprof = UserProfile.objects.get(user=request.user)
print(UserProfile.objects.filter(issue_flaged=issue))
DonnieBLT marked this conversation as resolved.
Show resolved Hide resolved
if userprof in UserProfile.objects.filter(issue_flaged=issue):
print("already flagged")
DonnieBLT marked this conversation as resolved.
Show resolved Hide resolved
userprof.issue_flaged.remove(issue)
else:
userprof.issue_flaged.add(issue)
Expand Down
4 changes: 2 additions & 2 deletions website/templates/_bug.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<path d="M16.0815 18.6604H7.46693H3.78564V9.4572H7.46693L12.2485 3.87867C12.7023 3.34933 13.4161 3.12177 14.0925 3.29086L14.1362 3.3018C15.3711 3.61052 15.9274 5.04941 15.2214 6.10849L12.9889 9.4572H17.1859C18.3474 9.4572 19.2186 10.5198 18.9908 11.6588L17.8864 17.1807C17.7143 18.0411 16.9589 18.6604 16.0815 18.6604Z" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
</button>
{% with user_issue_upvoted_list=bug.user.userprofile.issue_upvoted.all %}
{% with user_issue_upvoted_list=user.userprofile.issue_upvoted.all %}
{% if user_issue_upvoted_list and bug in user_issue_upvoted_list %}
<script>
$(document).ready(function () {
Expand All @@ -55,7 +55,7 @@
<path d="M4.06152 3.93531H18.7867L14.1851 8.53692L18.7867 13.1385H4.06152" stroke="#8C0000" stroke-opacity="0.74" stroke-width="1.65658" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
{% with user_issue_flagged_list=bug.user.userprofile.issue_flagged.all %}
{% with user_issue_flagged_list=user.userprofile.issue_flaged.all %}
{% if user_issue_flagged_list and bug in user_issue_flagged_list %}
<script>
$(document).ready(function () {
Expand Down
Loading