Skip to content

Commit

Permalink
Make token more unique to avoid conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
VirginiaDooley committed Jul 4, 2023
1 parent b3499b1 commit b6ff9ee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion wcivf/apps/feedback/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.utils import timezone
from django.http import HttpResponse
from django.views.generic import View, UpdateView
from django.utils.http import url_has_allowed_host_and_scheme
Expand Down Expand Up @@ -31,7 +32,9 @@ def is_spam(self):
def get_object(self, queryset=None):
token = self.request.POST.get("token")
try:
return Feedback.objects.get(token=token)
return Feedback.objects.get(
token=token, created__date=timezone.datetime.today()
)
except Feedback.DoesNotExist:
return Feedback(token=token)

Expand Down

0 comments on commit b6ff9ee

Please sign in to comment.