peopledoc / django-mail-factory

Django Mail Manager
Other
72 stars 17 forks source link

Check for mandatory context before calling get_context_data #64

Open bhrutledge opened 8 years ago

bhrutledge commented 8 years ago

In BaseMail.__init__, I think it would be helpful to validate context against self.get_params (and raise MissingMailContextParamException) before doing anything else. That way, self.get_context_data could safely reference the required params while adding additional context.

But, maybe there's some element of the flow that I'm missing...

Natim commented 8 years ago

@bhrutledge You are probably correct, do you mind working on a PR to fix that? I will be happy to review it and help.

bhrutledge commented 8 years ago

Will do!