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

Django 1.5 #17

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions payments/management/commands/init_customers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand

from django.contrib.auth.models import User

from payments.models import Customer
from payments.settings import TRIAL_PERIOD_FOR_USER_CALLBACK
from payments.settings import DEFAULT_PLAN
Expand All @@ -12,7 +11,7 @@ class Command(BaseCommand):
help = "Create customer objects for existing users that don't have one"

def handle(self, *args, **options):
for user in User.objects.filter(customer__isnull=True):
for user in get_user_model().objects.filter(customer__isnull=True):
trial_days = None
if TRIAL_PERIOD_FOR_USER_CALLBACK:
trial_days = TRIAL_PERIOD_FOR_USER_CALLBACK(user)
Expand Down
2 changes: 1 addition & 1 deletion payments/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class TransferChargeFee(models.Model):

class Customer(StripeObject):

user = models.OneToOneField(User, null=True)
user = models.OneToOneField(settings.AUTH_USER_MODEL, null=True)

plan = models.CharField(max_length=100, blank=True)

Expand Down