diff --git a/core/templates/core/user_detail.jinja b/core/templates/core/user_detail.jinja index e3791373..663877e3 100644 --- a/core/templates/core/user_detail.jinja +++ b/core/templates/core/user_detail.jinja @@ -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) %} {% trans %}New subscription{% endtrans %} {% endif %} +{% endif %}

{% endif %} diff --git a/locale/fr/LC_MESSAGES/django.mo b/locale/fr/LC_MESSAGES/django.mo index 6232bf32..e45bdf31 100644 Binary files a/locale/fr/LC_MESSAGES/django.mo and b/locale/fr/LC_MESSAGES/django.mo differ diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index 17b63648..eff07b8d 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -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 "" diff --git a/subscription/views.py b/subscription/views.py index d04911dd..cc1c0143 100644 --- a/subscription/views.py +++ b/subscription/views.py @@ -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'}