-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #253 from ZUS666/r/fix/cache_spots
invalid cache
- Loading branch information
Showing
4 changed files
with
15 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ | |
|
||
class SpotsConfig(AppConfig): | ||
name = 'spots' | ||
|
||
def ready(self) -> None: | ||
from spots import siglnals # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from django.db.models.signals import post_delete | ||
from django.dispatch import receiver | ||
|
||
from spots.models import Spot | ||
from spots.services import delete_location_cache_in_spot | ||
|
||
|
||
@receiver(post_delete, sender=Spot) | ||
def delete_cache_spots_signal(sender, instance, *args, **kwargs): | ||
delete_location_cache_in_spot(instance.location.id) |