mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 22:23:23 +00:00
user: fix populate for dev and use native django function to fetch payment_method
This commit is contained in:
parent
f6968facbe
commit
72a4bde6a2
@ -389,7 +389,7 @@ Welcome to the wiki page!
|
|||||||
s = Subscription(
|
s = Subscription(
|
||||||
member=User.objects.filter(pk=root.pk).first(),
|
member=User.objects.filter(pk=root.pk).first(),
|
||||||
subscription_type=default_subscription,
|
subscription_type=default_subscription,
|
||||||
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
|
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
|
||||||
)
|
)
|
||||||
s.subscription_start = s.compute_start()
|
s.subscription_start = s.compute_start()
|
||||||
s.subscription_end = s.compute_end(
|
s.subscription_end = s.compute_end(
|
||||||
@ -401,7 +401,7 @@ Welcome to the wiki page!
|
|||||||
s = Subscription(
|
s = Subscription(
|
||||||
member=User.objects.filter(pk=skia.pk).first(),
|
member=User.objects.filter(pk=skia.pk).first(),
|
||||||
subscription_type=default_subscription,
|
subscription_type=default_subscription,
|
||||||
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
|
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
|
||||||
)
|
)
|
||||||
s.subscription_start = s.compute_start()
|
s.subscription_start = s.compute_start()
|
||||||
s.subscription_end = s.compute_end(
|
s.subscription_end = s.compute_end(
|
||||||
@ -413,7 +413,7 @@ Welcome to the wiki page!
|
|||||||
s = Subscription(
|
s = Subscription(
|
||||||
member=User.objects.filter(pk=counter.pk).first(),
|
member=User.objects.filter(pk=counter.pk).first(),
|
||||||
subscription_type=default_subscription,
|
subscription_type=default_subscription,
|
||||||
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
|
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
|
||||||
)
|
)
|
||||||
s.subscription_start = s.compute_start()
|
s.subscription_start = s.compute_start()
|
||||||
s.subscription_end = s.compute_end(
|
s.subscription_end = s.compute_end(
|
||||||
@ -425,7 +425,7 @@ Welcome to the wiki page!
|
|||||||
s = Subscription(
|
s = Subscription(
|
||||||
member=User.objects.filter(pk=comptable.pk).first(),
|
member=User.objects.filter(pk=comptable.pk).first(),
|
||||||
subscription_type=default_subscription,
|
subscription_type=default_subscription,
|
||||||
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
|
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
|
||||||
)
|
)
|
||||||
s.subscription_start = s.compute_start()
|
s.subscription_start = s.compute_start()
|
||||||
s.subscription_end = s.compute_end(
|
s.subscription_end = s.compute_end(
|
||||||
@ -437,7 +437,7 @@ Welcome to the wiki page!
|
|||||||
s = Subscription(
|
s = Subscription(
|
||||||
member=User.objects.filter(pk=r.pk).first(),
|
member=User.objects.filter(pk=r.pk).first(),
|
||||||
subscription_type=default_subscription,
|
subscription_type=default_subscription,
|
||||||
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
|
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
|
||||||
)
|
)
|
||||||
s.subscription_start = s.compute_start()
|
s.subscription_start = s.compute_start()
|
||||||
s.subscription_end = s.compute_end(
|
s.subscription_end = s.compute_end(
|
||||||
@ -449,7 +449,7 @@ Welcome to the wiki page!
|
|||||||
s = Subscription(
|
s = Subscription(
|
||||||
member=User.objects.filter(pk=subscriber.pk).first(),
|
member=User.objects.filter(pk=subscriber.pk).first(),
|
||||||
subscription_type=default_subscription,
|
subscription_type=default_subscription,
|
||||||
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
|
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
|
||||||
)
|
)
|
||||||
s.subscription_start = s.compute_start()
|
s.subscription_start = s.compute_start()
|
||||||
s.subscription_end = s.compute_end(
|
s.subscription_end = s.compute_end(
|
||||||
@ -461,7 +461,7 @@ Welcome to the wiki page!
|
|||||||
s = Subscription(
|
s = Subscription(
|
||||||
member=User.objects.filter(pk=old_subscriber.pk).first(),
|
member=User.objects.filter(pk=old_subscriber.pk).first(),
|
||||||
subscription_type=default_subscription,
|
subscription_type=default_subscription,
|
||||||
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
|
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
|
||||||
)
|
)
|
||||||
s.subscription_start = s.compute_start(datetime(year=2012, month=9, day=4))
|
s.subscription_start = s.compute_start(datetime(year=2012, month=9, day=4))
|
||||||
s.subscription_end = s.compute_end(
|
s.subscription_end = s.compute_end(
|
||||||
@ -841,7 +841,7 @@ Welcome to the wiki page!
|
|||||||
s = Subscription(
|
s = Subscription(
|
||||||
member=User.objects.filter(pk=sli.pk).first(),
|
member=User.objects.filter(pk=sli.pk).first(),
|
||||||
subscription_type=list(settings.SITH_SUBSCRIPTIONS.keys())[0],
|
subscription_type=list(settings.SITH_SUBSCRIPTIONS.keys())[0],
|
||||||
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
|
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
|
||||||
)
|
)
|
||||||
s.subscription_start = s.compute_start()
|
s.subscription_start = s.compute_start()
|
||||||
s.subscription_end = s.compute_end(
|
s.subscription_end = s.compute_end(
|
||||||
@ -853,7 +853,7 @@ Welcome to the wiki page!
|
|||||||
s = Subscription(
|
s = Subscription(
|
||||||
member=User.objects.filter(pk=krophil.pk).first(),
|
member=User.objects.filter(pk=krophil.pk).first(),
|
||||||
subscription_type=list(settings.SITH_SUBSCRIPTIONS.keys())[0],
|
subscription_type=list(settings.SITH_SUBSCRIPTIONS.keys())[0],
|
||||||
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
|
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
|
||||||
)
|
)
|
||||||
s.subscription_start = s.compute_start()
|
s.subscription_start = s.compute_start()
|
||||||
s.subscription_end = s.compute_end(
|
s.subscription_end = s.compute_end(
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
from datetime import date, timedelta
|
from datetime import date, timedelta
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from ast import literal_eval as make_tuple
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
@ -72,10 +71,6 @@ class Subscription(models.Model):
|
|||||||
verbose_name=_("location"),
|
verbose_name=_("location"),
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_payment_method_display(self):
|
|
||||||
|
|
||||||
return _(make_tuple(self.payment_method)[1])
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ["subscription_start"]
|
ordering = ["subscription_start"]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user