From fe2438ef0cc6d8c70907fbb035f31da950d37218 Mon Sep 17 00:00:00 2001 From: Skia Date: Mon, 29 Aug 2016 19:48:29 +0200 Subject: [PATCH] Fix subscription right and typo --- core/templates/core/user_detail.jinja | 2 ++ locale/fr/LC_MESSAGES/django.mo | Bin 31955 -> 31953 bytes locale/fr/LC_MESSAGES/django.po | 4 ++-- subscription/views.py | 8 +++++++- 4 files changed, 11 insertions(+), 3 deletions(-) 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 6232bf326b7286274b7403e40092c8794af5816f..e45bdf318008808c6909d21ed6fa4a26bc2a4bb0 100644 GIT binary patch delta 3501 zcmXZdc~DkW7{~DguZk=JD!AmvA_i`ZGzvKCV46;Y%edr*DGHdNv4~oV&do+GE30uz zqd_OL)KU{u!crV7TXakj$H{WZq=stDCCxOe>HG6Oe|^q*?z!hY=Q-!T@9Dcir|t$- zPmJ**opZHQoeRM)F&a;pKVTdB*Rcf#ra9LP!%*X+Q1SK{ie0f2CgU(1j;Z)O7U6!> zxWpXaJ~_^Ftq7zOXo-(t0*=8rEW;pNhg$eG48}?fU==Enw=fE~TYtax51aKE$MZ|r z8iS@g7lUo5d;W{b1T-K6V{t0>z!FqK>rs{Y7*&yD7=ag1iTs921Ps)Doq#br=liKMfL{S!ymqjbDme@I_SO zskz)2?2jbmxzRL+5SWBI>(@~`+knb&GisrIsG~WEiZ`If{ftWB8tO=H;e!}7%en5D zf;#IlsQL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 +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'}