Skip to content

Commit

Permalink
Add deprecation warning in code and docs per dj-stripe#86
Browse files Browse the repository at this point in the history
  • Loading branch information
pydanny committed May 2, 2014
1 parent 0b8de9d commit 663fecb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ History
0.3.6 (2014-05-??)
----------------------

* Placed `StripeSubscriptionSignupForm` into deprecation mode. It will probably be removed in the 0.4 release.
* Enable proration when customer upgrades plan, and pass proration policy for upgrades in settings. (Thanks Yasmine Charif)
* Pass proration policy and cancellation at period end in settings. (Thanks Yasmine Charif)
* Fix correct plan selection on subscription in subscribe_form template. (Thanks Yasmine Charif)
Expand Down
8 changes: 8 additions & 0 deletions djstripe/forms.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import warnings

from django.conf import settings
from django import forms
from django.utils.translation import ugettext as _
Expand Down Expand Up @@ -111,3 +113,9 @@ def save(self, user):
except stripe.StripeError as e:
# handle error here
raise e

def __init__(self, *args, **kwargs):
if settings.DEBUG:
msg = "djstripe.forms.StripeSubscriptionSignupForm is now deprecated. djstripe recommends the standard two-stage account creation processes."
warnings.warn(msg, DeprecationWarning, stacklevel=2)
super(StripeSubscriptionSignupForm, self).__init__(*args, **kwargs)
13 changes: 13 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,19 @@ Described is an anti-pattern. View logic belongs in views.py, not urls.py.
Subscriptions + Registration
=============================

.. warning:: Deprecation Warning!

Because this combines identity and financial submissions in one form, it's
arguably a security risk. Instead, we recommend using the standard two-stage
registration process, where personal info is gathered on one page, and CC
information on the next.

Therefore, using this technique will trigger a deprecation warning while in
DEBUG mode.

Discussion: https://github.com/pydanny/dj-stripe/issues/86


This requires the following additional requirements:

* django-allauth (user registration)
Expand Down

0 comments on commit 663fecb

Please sign in to comment.