def handle(self, username, debug=None, *args, **options): if debug is not None: message, email = resend_mail(username, send=False) else: message, email = resend_mail(username) print "To: %s" % email print message if debug is not None: print "(No email sent because the command was run with debug mode ON)" else: print "(Email sent)" return
def resend_confirmation_email(request): if not request.user.is_staff: return HttpResponseForbidden() if request.method == "GET": return renderform(request) username = request.POST['username'] try: user = User.objects.get(username=username) except User.DoesNotExist: return nosuchuser(request, username) if user.is_active: return notinactive(request, username) resend_mail(username) return {'username': username, 'user': user}