Exemple #1
0
 def form_valid(self, form):
     APIClient(**settings.API_CLIENT).post_transaction(
         user_agent=utils.get_request_user_agent(self.request),
         msisdn=utils.get_request_msisdn(self.request),
         client_ip=utils.get_request_ip(self.request),
         data=form.get_json_data())
     return super(ProductView, self).form_valid(form)
Exemple #2
0
 def get_context_data(self, **kwargs):
     kwargs = super(WatchView, self).get_context_data(**kwargs)
     kwargs['object'] = APIClient(**settings.API_CLIENT).get_stream_url(
         self.kwargs['content_type'], self.kwargs['slug'],
         user_agent=utils.get_request_user_agent(self.request),
         msisdn=utils.get_request_msisdn(self.request),
         client_ip=utils.get_request_ip(self.request))
     return kwargs
Exemple #3
0
 def get_context_data(self, **kwargs):
     kwargs = super(AccountView, self).get_context_data(**kwargs)
     kwargs['object'] = APIClient(**settings.API_CLIENT).get_account_info(
         msisdn=utils.get_request_msisdn(self.request),
         client_ip=utils.get_request_ip(self.request))
     return kwargs
Exemple #4
0
 def form_valid(self, form):
     APIClient(**settings.API_CLIENT).post_profile(
         msisdn=utils.get_request_msisdn(self.request),
         client_ip=utils.get_request_ip(self.request),
         data=form.get_json_data())
     return super(ProfileView, self).form_valid(form)