From c72fc64b8b0ab012145888678b2e431d1093dfea Mon Sep 17 00:00:00 2001 From: Andrew Buss Date: Tue, 2 Jun 2015 21:38:27 -0700 Subject: [PATCH] allow a user to hide a card twice - the second reason overwrites the original --- flashcards/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flashcards/models.py b/flashcards/models.py index cacd0ef..4a8e335 100644 --- a/flashcards/models.py +++ b/flashcards/models.py @@ -354,7 +354,8 @@ class Flashcard(Model): flashcards.pushes.push_deck_event('card_hidden', self, user) if self.is_in_deck(user): user.unpull(self) - hide, created = FlashcardHide.objects.get_or_create(user=user, flashcard=self, reason=reason) + hide, created = FlashcardHide.objects.get_or_create(user=user, flashcard=self) + hide.reason = reason hide.save() def unhide_by_user(self, user, reason=None): -- 1.9.1