#217 Prevent User from sending a Happiness Packet to themselves
Closed: complete 4 years ago by jflory7. Opened 5 years ago by shraddhaag.

Summary

Prevent User from sending a Happiness Packet to themselves

Background

Currently a User can send a Happiness Packet to themselves. This needs to be rectified to implement the Leaderboard functionality.

Details

There is no validation in the front-end/back-end that alerts/stops a User to send a Happiness Packet to themselves.

In the back-end the check can be added in messaging/forms.py that is performed while saving the message and an alert can be displayed in front-end if the check returns True and an error is raised.

A quicker way to let the user know this is implementing the same validation and displaying the alert in front-end using JavaScript. This would save time as the alert will be displayed as soon as the same address is entered in the recipient_email and not wait for the user to click submit to perform validation.

Outcome

User is not able to send a Happiness Packet to themselves.


Form validation and displaying an alert in front-end using JavaScript will be a good solution. We will watch the input field and check it with Logged In user's mail every time the Reciever mail changes, and whenever a match is found, we could send an alert message and disable the submit button. Good work @shraddhaag :) I would like to take up the task @jflory7

Metadata Update from @jflory7:
- Issue priority set to: waiting on assignee (was: awaiting triage)
- Issue tagged with: PASSED, difficulty - medium, improvement, type - backend, type - frontend, type - summer coding

5 years ago

@shraddhaag Thanks for opening the ticket!

@alishapapun Sure! This sounds like the right approach to me. :thumbsup: I'm assigning this one to you.

Metadata Update from @jflory7:
- Issue assigned to alishapapun

5 years ago

I made a PR regarding the same in #225

I have added the email-normalize dependency to normalize both the emails and check to stop from spamming by creating new accounts.

Metadata Update from @jflory7:
- Issue set to the milestone: Summer Coding 2019: community bonding

4 years ago

PR #225 just merged. Thanks for taking this one on @alishapapun! Closing as complete. :checkered_flag:

Metadata Update from @jflory7:
- Issue close_status updated to: complete
- Issue status updated to: Closed (was: Open)

4 years ago

Login to comment on this ticket.

Metadata