Branch: refs/heads/master Author: Enrico Tröger enrico.troeger@uvena.de Committer: Enrico Tröger enrico.troeger@uvena.de Date: Wed, 01 May 2019 13:09:53 UTC Commit: 21ed2eceab7f862cb6b788b82499252a07e22a28 https://github.com/geany/www.geany.org/commit/21ed2eceab7f862cb6b788b8249925...
Log Message: ----------- Don't delete expired snippets implicitly when viewing snippets
Instead, we will use a cronjob to regularly clean expired snippets.
Modified Paths: -------------- pastebin/views.py
Modified: pastebin/views.py 9 lines changed, 0 insertions(+), 9 deletions(-) =================================================================== @@ -20,7 +20,6 @@ from django.shortcuts import get_object_or_404, render from django.template.response import TemplateResponse from django.urls import reverse -from django.utils import timezone from django.utils.decorators import method_decorator from django.utils.translation import ugettext_lazy as _ from django.views.decorators.csrf import csrf_exempt @@ -100,8 +99,6 @@ def dispatch(self, request, *args, **kwargs):
# ---------------------------------------------------------------------- def get(self, request, snippet_id): - # housekeeping - self._clean_expired_snippets() # load snippet try: snippet = self._fetch_snippet(snippet_id) @@ -123,12 +120,6 @@ def get(self, request, snippet_id):
return render(request, self.template_name, template_context)
- # ---------------------------------------------------------------------- - def _clean_expired_snippets(self): - deleteable_snippets = Snippet.objects.filter(expires__lte=timezone.now()) - if deleteable_snippets: - deleteable_snippets.delete() - # ---------------------------------------------------------------------- def _fetch_snippet(self, snippet_id): try:
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).