示例#1
0
    def get_context_data(self, **kwargs):
        context = super(UserMixin, self).get_context_data(**kwargs)
        update_context_urls(
            context, {
                'profile_base': reverse('saas_profile'),
                'user': {
                    'accessibles':
                    reverse('saas_user_product_list', args=(self.user, )),
                    'notifications':
                    reverse('users_notifications', args=(self.user, )),
                    'profile':
                    reverse('users_profile', args=(self.user, )),
                }
            })
        organization = self.attached_organization
        if organization and not organization.is_broker:
            # A broker does not have subscriptions.

            # Duplicate code from `saas.extras.OrganizationMixinBase` since
            # it does not get inherited in the context of a `UserMixin`.
            update_context_urls(
                context, {
                    'organization': {
                        'billing':
                        reverse('saas_billing_info', args=(organization, )),
                        'subscriptions':
                        reverse('saas_subscription_list',
                                args=(organization, )),
                    }
                })

        return context
示例#2
0
    def get_context_data(self, **kwargs):
        context = super(ProcessorAuthorizeView,
                        self).get_context_data(**kwargs)
        provider = self.organization

        kwargs = {}
        if (hasattr(settings, 'STRIPE_CONNECT_CALLBACK_URL')
                and settings.STRIPE_CONNECT_CALLBACK_URL):
            kwargs = {
                'redirect_uri': settings.STRIPE_CONNECT_CALLBACK_URL,
            }
        authorize_url = self.processor_backend.get_authorize_url(
            provider, **kwargs)
        if authorize_url:
            update_context_urls(context,
                                {'authorize_processor': authorize_url})
        if (hasattr(settings, 'STRIPE_TEST_CONNECT_CALLBACK_URL')
                and settings.STRIPE_TEST_CONNECT_CALLBACK_URL):
            authorize_url = self.processor_backend.get_authorize_url(
                provider,
                client_id=settings.STRIPE_TEST_CLIENT_ID,
                redirect_uri=settings.STRIPE_TEST_CONNECT_CALLBACK_URL)
            if authorize_url:
                update_context_urls(
                    context, {'authorize_processor_test': authorize_url})
        return context
示例#3
0
 def get_context_data(self, **kwargs):
     context = super(DashboardView, self).get_context_data(**kwargs)
     if self.organization.is_broker:
         update_context_urls(
             context, {
                 'recent_activity': reverse('api_recent_activity'),
                 'api_todos': reverse('api_todos')
             })
     return context
示例#4
0
 def get_context_data(self, **kwargs):
     context = super(UserMixin, self).get_context_data(**kwargs)
     update_context_urls(
         context, {
             'profile_base': reverse('saas_profile'),
             'user': {
                 'accessibles':
                 reverse('saas_user_product_list', args=(self.user, )),
                 'notifications':
                 reverse('users_notifications', args=(self.user, )),
                 'profile':
                 reverse('users_profile', args=(self.user, )),
             }
         })
     return context
示例#5
0
 def get_context_data(self, **kwargs):
     context = super(ContactView, self).get_context_data(**kwargs)
     update_context_urls(context,
                         {'api_contact_us': reverse('api_contact_us')})
     return context