Merge branch 'master' into ola_fulfill

pull/1/head
Raymond Yee 2012-07-10 14:15:28 -07:00
commit 7a76a2cbaf
2 changed files with 12 additions and 10 deletions

View File

@ -65,17 +65,19 @@ def send_mail_task(subject, message, from_email, recipient_list,
"""a task to drop django.core.mail.send_mail into """
# NOTE: since we are currently using Amazon SES, which allows email to be sent only from validated email
# addresses, we force from_email to be one of the validated address unless override_from_email is FALSE
if override_from_email:
try:
from_email = settings.DEFAULT_FROM_EMAIL
except:
pass
return send_mail(subject, message, from_email, recipient_list, fail_silently=False, auth_user=auth_user,
try:
if override_from_email:
try:
from_email = settings.DEFAULT_FROM_EMAIL
except:
pass
r= send_mail(subject, message, from_email, recipient_list, fail_silently=False, auth_user=auth_user,
auth_password=auth_password, connection=connection)
except:
r=logger.info('failed to send message:' + message)
return r
#task to update the status of active campaigns
@task
def update_active_campaign_status():
"""update the status of all active campaigns -- presumed to be run at midnight Eastern time"""

View File

@ -338,7 +338,7 @@ def manage_campaign(request, id):
campaign = get_object_or_404(models.Campaign, id=id)
campaign.not_manager=False
campaign.problems=[]
if (not request.user.is_authenticated) or (not request.user in campaign.managers.all()):
if (not request.user.is_authenticated) or (not request.user in campaign.managers.all() and not request.user.is_staff):
campaign.not_manager=True
return render(request, 'manage_campaign.html', {'campaign': campaign})
alerts = []