mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	make mehtod name mandatory
This commit is contained in:
		| @@ -1,7 +1,7 @@ | ||||
| import logging | ||||
| from datetime import timedelta | ||||
| from django.conf import settings | ||||
|  | ||||
| from django.conf import settings | ||||
| from django.template.loader import render_to_string | ||||
|  | ||||
| from allauth.account.models import EmailAddress | ||||
| @@ -24,6 +24,10 @@ class NotificationMethod: | ||||
|         if (not hasattr(self, 'send')) and (not hasattr(self, 'send_bulk')): | ||||
|             raise NotImplementedError('A NotificationMethod must either define a `send` or a `send_bulk` method') | ||||
|  | ||||
|         # No method name is no good | ||||
|         if self.METHOD_NAME in ('', None): | ||||
|             raise NotImplementedError(f'The NotificationMethod {self.__class__} did not provide a METHOD_NAME') | ||||
|  | ||||
|         # Define arguments | ||||
|         self.obj = obj | ||||
|         self.entry_name = entry_name | ||||
|   | ||||
		Reference in New Issue
	
	Block a user