Skip to content

Commit 92a51f1

Browse files
committed
fixed tag bug
1 parent 8b8b0c4 commit 92a51f1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,10 @@ def add_tag():
505505
cursor.execute(query, (tagee, photoID, True))
506506
conn.commit()
507507
else:
508-
query = 'SELECT photoID FROM Photo AS p WHERE p.photoID IN (SELECT photoID FROM Belong NATURAL JOIN Share WHERE username = %s AND accepted = 1) OR (allfollowers = 1 AND EXISTS (SELECT * FROM Follow WHERE followerUsername = %s and followeeUsername = p.photoOwner)) OR (p.photoOwner = %s)'
509-
cursor.execute(query, (tagee, tagee, tagee))
508+
query = 'SELECT photoID FROM Photo AS p WHERE (p.photoID IN (SELECT photoID FROM Belong NATURAL JOIN Share WHERE username = %s AND accepted = 1) OR (allfollowers = 1 AND EXISTS (SELECT * FROM Follow WHERE followerUsername = %s and followeeUsername = p.photoOwner)) OR (p.photoOwner = %s)) AND (p.photoID = %s)'
509+
cursor.execute(query, (tagee, tagee, tagee, photoID))
510510
data = cursor.fetchall()
511-
# print(data)
511+
print(data)
512512
# print(data[0]["photoID"])
513513
# print(photoID)
514514
if len(data) > 0 and int(photoID) == data[0]["photoID"]:

templates/add_tag.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
{% for tagee in requests %}
3232
<tr>
3333
<td>{{ tagee.username }} on photo {{ tagee.photoID }} by {{ tagee.photoOwner }}</td>
34-
<td><a href="/accept_tag/{{ tagee.username }}/{{ photoID }}">Accept</a></td>
35-
<td><a href="/reject_tag/{{ tagee.username }}/{{ photoID }}">Reject</a></td>
34+
<td><a href="/accept_tag/{{ tagee.username }}/{{ tagee.photoID }}">Accept</a></td>
35+
<td><a href="/reject_tag/{{ tagee.username }}/{{ tagee.photoID }}">Reject</a></td>
3636
</tr>
3737
{% endfor %}
3838
</table>

0 commit comments

Comments
 (0)