Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This should return None rather than 404
- def get_sending_domain(company, domain):
- """
- Retrieve sending domain details from company's Sparkpost subaccount.
- """
- sparkpost_subaccount = get_sparkpost_subaccount(company)
- if not sparkpost_subaccount:
- return http.HttpResponse(status=404)
- # So if it doesn't return an error, I need to throw an error on the parent method, which is:
- def get_company_email_sending_domain(request, pk):
- """
- Get specific sending domain details for company on Sparkpost
- """
- domain = request.body
- company = get_object_or_404(comp_models.Company, pk=pk)
- result = sparkpost.get_sending_domain(company, domain)
- return http.JsonResponse({
- 'success': True,
- 'domain': result,
- }, status=200)
- # Soooo... do I just throw a 404 here?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement