Commit 22f26c6fac44e554120980224f1a004560cb1f4a
1 parent
a3f17ed32e
Exists in
master
hide the old card when we edit
Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff
flashcards/models.py
View file @
22f26c6
... | ... | @@ -19,6 +19,7 @@ |
19 | 19 | from cached_property import cached_property |
20 | 20 | |
21 | 21 | |
22 | + | |
22 | 23 | # Hack to fix AbstractUser before subclassing it |
23 | 24 | |
24 | 25 | AbstractUser._meta.get_field('email')._unique = True |
... | ... | @@ -346,6 +347,7 @@ |
346 | 347 | self.pk = None |
347 | 348 | self.mask = new_data.get('mask', self.mask) |
348 | 349 | self.save() |
350 | + user.hide(Flashcard.objects.get(pk=self.previous_id)) | |
349 | 351 | user.pull(self) |
350 | 352 | else: |
351 | 353 | user_card, created = UserFlashcard.objects.get_or_create(user=user, flashcard=self) |
... | ... | @@ -354,6 +356,7 @@ |
354 | 356 | if not create_new: |
355 | 357 | self.save() |
356 | 358 | import flashcards.pushes |
359 | + | |
357 | 360 | flashcards.pushes.push_deck_event('card_fixed', self, user) |
358 | 361 | return self |
359 | 362 |