Skip to content

Commit

Permalink
Hide gifted gifts
Browse files Browse the repository at this point in the history
  • Loading branch information
TaaviE committed Jan 4, 2019
1 parent c919d6a commit 6f76944
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion views.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
from flask_dance.contrib.facebook import make_facebook_blueprint
from flask_dance.contrib.github import make_github_blueprint
from flask_dance.contrib.google import make_google_blueprint
from sqlalchemy import and_
from sqlalchemy.orm.exc import NoResultFound

# Translation
Expand Down Expand Up @@ -261,7 +262,9 @@ def notes():
empty = False

try:
db_notes = Wishlist.query.filter(Wishlist.user_id == user_id).all()
# noinspection PyComparisonWithNone
# SQLAlchemy doesn't like "is None"
db_notes = Wishlist.query.filter(and_(Wishlist.user_id == user_id, Wishlist.received == None)).all()
for note in db_notes:
notes_from_file[note.item] = encrypt_id(note.id)
except Exception as e:
Expand Down Expand Up @@ -588,6 +591,9 @@ def giftingto():
modifyable = False
name = ""

if note.received is not None:
continue

if note.status == NoteState.DEFAULT.value["id"]:
selections = all_states
selections.insert(0, selections.pop(selections.index(NoteState.DEFAULT.value)))
Expand Down

0 comments on commit 6f76944

Please sign in to comment.