Merge branch 'mailing' into 'master'

Enhance mailing list edition for clubs with brand new form

See merge request ae/Sith!200
This commit is contained in:
2019-05-20 17:39:43 +02:00
9 changed files with 983 additions and 430 deletions

View File

@ -837,6 +837,27 @@ Welcome to the wiki page!
krophil_profile.save()
krophil.profile_pict = krophil_profile
krophil.save()
# Adding user Com Unity
comunity = User(
username="comunity",
last_name="Unity",
first_name="Com",
email="comunity@git.an",
date_of_birth="1942-06-12",
)
comunity.set_password("plop")
comunity.save()
comunity.groups = [
Group.objects.filter(name="Communication admin").first().id
]
comunity.save()
Membership(
user=comunity,
club=bar_club,
start_date=timezone.now(),
role=settings.SITH_CLUB_ROLES_ID["Board member"],
).save()
# Adding subscription for sli
s = Subscription(
member=User.objects.filter(pk=sli.pk).first(),
@ -861,6 +882,18 @@ Welcome to the wiki page!
start=s.subscription_start,
)
s.save()
# Com Unity
s = Subscription(
member=comunity,
subscription_type=default_subscription,
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
)
s.subscription_start = s.compute_start()
s.subscription_end = s.compute_end(
duration=settings.SITH_SUBSCRIPTIONS[s.subscription_type]["duration"],
start=s.subscription_start,
)
s.save()
Selling(
label=dcons.name,

View File

@ -296,11 +296,6 @@ class DetailFormView(SingleObjectMixin, FormView):
"""
return super(DetailFormView, self).get_object()
def get_context_data(self, *args, **kwargs):
kwargs = super(DetailFormView, self).get_context_data()
kwargs["object"] = self.get_object()
return kwargs
from .user import *
from .page import *