From 2ef577ab4547e96b431630d9abbdbacc120c54b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dlouh=C3=BD?= Date: Mon, 8 Jun 2020 16:26:13 +0200 Subject: [PATCH] use NotImplementedError instead of returning none first_name/last_name --- payments/models.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/payments/models.py b/payments/models.py index 8e3b70045..9eccad74a 100644 --- a/payments/models.py +++ b/payments/models.py @@ -149,29 +149,32 @@ def get_user(self): def get_user_email(self): """ Get user email """ try: + # Most common implementation return self.get_user().email except AttributeError: - return None + raise NotImplementedError() def get_user_first_name(self): """ - Get user first name + Get user first name for purposes of the payment provider Used only by PayU provider for now """ try: + # Most common implementation return self.get_user().first_name except AttributeError: - return None + raise NotImplementedError() def get_user_last_name(self): """ - Get user last name + Get user last name for purposes of the payment provider Used only by PayU provider for now """ try: + # Most common implementation return self.get_user().last_name except AttributeError: - return None + raise NotImplementedError() def get_renew_token(self): """