Fix subscription right and typo

This commit is contained in:
Skia 2016-08-29 19:48:29 +02:00
parent 3305a19f44
commit fe2438ef0c
4 changed files with 11 additions and 3 deletions

View File

@ -48,8 +48,10 @@
{% trans subscription_end=get_subscriber(profile).subscriptions.last().subscription_end %}Subscribed until {{ subscription_end }}{% endtrans %}
{% else %}
{% trans %}Not subscribed{% endtrans %}
{% if user.is_in_group(settings.SITH_MAIN_BOARD_GROUP) %}
<a href="{{ url('subscription:subscription') }}?member={{ profile.id }}">{% trans %}New subscription{% endtrans %}</a>
{% endif %}
{% endif %}
</p>
{% endif %}

Binary file not shown.

View File

@ -1768,7 +1768,7 @@ msgstr "Compte utilisateur"
#: sith/settings.py:310 sith/settings_sample.py:265
#: sith/settings_sample.py:270 sith/settings_sample.py:292
msgid "Credit card"
msgstr "Carte banquaire"
msgstr "Carte bancaire"
#: counter/models.py:252
msgid "selling"
@ -2061,7 +2061,7 @@ msgstr "État du panier"
#: eboutic/templates/eboutic/eboutic_makecommand.jinja:35
msgid "Pay with credit card"
msgstr "Payer avec une carte banquaire"
msgstr "Payer avec une carte bancaire"
#: eboutic/templates/eboutic/eboutic_makecommand.jinja:38
msgid ""

View File

@ -66,10 +66,16 @@ class SubscriptionForm(forms.ModelForm):
raise ValidationError(_("You must either choose an existing user or create a new one properly"))
return cleaned_data
class NewSubscription(CanEditMixin, CreateView):
class NewSubscription(CreateView):
template_name = 'subscription/subscription.jinja'
form_class = SubscriptionForm
def dispatch(self, request, *arg, **kwargs):
res = super(NewSubscription, self).dispatch(request, *arg, **kwargs)
if request.user.is_in_group(settings.SITH_MAIN_BOARD_GROUP):
return res
raise PermissionDenied
def get_initial(self):
if 'member' in self.request.GET.keys():
return {'member': self.request.GET['member'], 'subscription_type': 'deux-semestres'}