当前位置: 首页>>代码示例>>Python>>正文


Python EmailMessage.sender_id方法代码示例

本文整理汇总了Python中myrobogals.rgmessages.models.EmailMessage.sender_id方法的典型用法代码示例。如果您正苦于以下问题:Python EmailMessage.sender_id方法的具体用法?Python EmailMessage.sender_id怎么用?Python EmailMessage.sender_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在myrobogals.rgmessages.models.EmailMessage的用法示例。


在下文中一共展示了EmailMessage.sender_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: check_default_pass

# 需要导入模块: from myrobogals.rgmessages.models import EmailMessage [as 别名]
# 或者: from myrobogals.rgmessages.models.EmailMessage import sender_id [as 别名]
def check_default_pass():
	users = User.objects.all()
	for u in users:
		if check_password("newrg123", u.password):
			message = EmailMessage()
			message.body = "Dear " + u.first_name + ",\n\nYou are recieving this automated email because your myRobogals account is still set to use the default password. This is a security risk and exposes your myRobogals account to potentially being used by others.\n\nPlease login at http://my.robogals.org using the following credentials:\nUsername: " + u.username + "\nPassword: newrg123\n\nOnce you have logged in, please change your password.\n\nThankyou,\n\nmyRobogals password nagging bot :)"
			message.subject = "Warning: Account is using default password"
			message.from_address = "[email protected]"
			message.from_name = "myRobogals"
			message.reply_address = "[email protected]"
			message.html = False
			message.status = -1
			message.sender_id = 168
			message.save()
			recipient = EmailRecipient()
			recipient.message = message
			recipient.user = u
			recipient.to_name = u.get_full_name()
			recipient.to_address = u.email
			recipient.save()
			message.status = 0
			message.save()
开发者ID:CodeMontage,项目名称:myrobogals,代码行数:24,代码来源:check_default_pass.py


注:本文中的myrobogals.rgmessages.models.EmailMessage.sender_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。