Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent duplicates of ReferralResponse entries #15

Open
anilshanbhag opened this issue Mar 11, 2014 · 1 comment
Open

Prevent duplicates of ReferralResponse entries #15

anilshanbhag opened this issue Mar 11, 2014 · 1 comment

Comments

@anilshanbhag
Copy link

Currently when the user visits the referral link, a ReferralResponse entry is created. However if the user opens the same referral link multiple times, this creates multiple entries containing the same data.

I think it would be better to use ReferralResponse.objects.get_or_create(**kwargs) instead of ReferralResponse.objects.create(**kwargs) in the respond method of Referral model

@heliodor
Copy link

Some developers might find multiple referrals useful. Instead, there should be an option to make a single record of multiple visits to the same referral. Given that the option can be set to record every visit to the referral code, the ReferralResponse model should provide a convenience function to de-dup the responses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants