Feature/dont pass profile to send_email_verification
Created by: das-g
Merge request reports
Activity
18 18 class SendVerificationEmailMixin(object): 19 19 RATE_LIMIT_SECONDS = 30 20 20 21 def _send_email_verification(self, profile): 22 if cache.get(profile.associated_user.id): 21 def _send_email_verification(self): Created by: das-g
The current callers ensure this or at least assume it, otherwise they wouldn't have been able to pass the profile. But we can't really guarantee it for future callers or future revisions of the current callers.
Would this be reason to keep the profile argument?
An alternative refactoring would be to make
_send_email_verification
a public method ofmodels.Profile
.Created by: hixi
I like that one much better, i puts readable names and clearer structure on the Profile module, which is the one that should be concerned with this, IMO. I accidentally already merged it, if you don't agree with the change merge, I'll revert it - otherwise, I think we can close this issue.
Please register or sign in to reply