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 399dd01 commit e17b2de
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion wcivf/apps/feedback/views.py
@@ -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 e17b2de

Please sign in to comment.