From 36f1b7818ffa93156afc56fdbb81ef111f49f625 Mon Sep 17 00:00:00 2001 From: kracekumar Date: Mon, 10 Jun 2013 17:57:53 +0530 Subject: [PATCH 1/2] Fixed subject line of participant status email --- hacknight/models/participant.py | 10 +++++++++- hacknight/views/event.py | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/hacknight/models/participant.py b/hacknight/models/participant.py index e141e3d..b4fc47c 100644 --- a/hacknight/models/participant.py +++ b/hacknight/models/participant.py @@ -4,7 +4,7 @@ from hacknight.models.user import User from hacknight.models.event import Event -__all__ = ['Participant', 'PARTICIPANT_STATUS'] +__all__ = ['Participant', 'PARTICIPANT_STATUS', 'participant_status'] class PARTICIPANT_STATUS: @@ -14,6 +14,14 @@ class PARTICIPANT_STATUS: REJECTED = 3 WITHDRAWN = 4 +participant_status = { + PARTICIPANT_STATUS.PENDING: "pending", + PARTICIPANT_STATUS.WL: "waitlisted", + PARTICIPANT_STATUS.CONFIRMED: "confirmed", + PARTICIPANT_STATUS.REJECTED: "rejected", + PARTICIPANT_STATUS.WITHDRAWN: "withdrawn", +} + class Participant(BaseMixin, db.Model): __tablename__ = 'participant' diff --git a/hacknight/views/event.py b/hacknight/views/event.py index 6aed587..24381eb 100644 --- a/hacknight/views/event.py +++ b/hacknight/views/event.py @@ -8,7 +8,7 @@ from coaster.views import load_model, load_models from baseframe.forms import render_redirect, render_form, render_delete_sqla from hacknight import app, mail -from hacknight.models import db, Profile, Event, User, Participant, PARTICIPANT_STATUS, EventRedirect +from hacknight.models import db, Profile, Event, User, Participant, PARTICIPANT_STATUS, EventRedirect, participant_status from hacknight.forms.event import EventForm, ConfirmWithdrawForm, SendEmailForm, EmailEventParticipantsForm from hacknight.forms.participant import ParticipantForm from hacknight.views.login import lastuser @@ -172,7 +172,7 @@ def event_update_participant_status(profile, event): message = message.replace("*|FULLNAME|*", participant.user.fullname) if message and g.user.email: send_email(sender=(g.user.fullname, g.user.email), to=participant.email, - subject="%s - Hacknight participation status" % event.title , body=text_message, html=message) + subject="%s participation is %s" %(event.title, participant_status.get(participant.status)), body=text_message, html=message) except KeyError: pass db.session.commit() From 1595048809ac763593635f3c3331dc41f3c377cd Mon Sep 17 00:00:00 2001 From: kracekumar Date: Tue, 18 Jun 2013 14:05:06 +0530 Subject: [PATCH 2/2] modified email subject message retrieval --- hacknight/models/participant.py | 10 +++++----- hacknight/views/event.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hacknight/models/participant.py b/hacknight/models/participant.py index b4fc47c..fe5591c 100644 --- a/hacknight/models/participant.py +++ b/hacknight/models/participant.py @@ -15,11 +15,11 @@ class PARTICIPANT_STATUS: WITHDRAWN = 4 participant_status = { - PARTICIPANT_STATUS.PENDING: "pending", - PARTICIPANT_STATUS.WL: "waitlisted", - PARTICIPANT_STATUS.CONFIRMED: "confirmed", - PARTICIPANT_STATUS.REJECTED: "rejected", - PARTICIPANT_STATUS.WITHDRAWN: "withdrawn", + PARTICIPANT_STATUS.PENDING: "participation is pending", + PARTICIPANT_STATUS.WL: "participation is waitlisted", + PARTICIPANT_STATUS.CONFIRMED: "participation is confirmed", + PARTICIPANT_STATUS.REJECTED: "participation is rejected", + PARTICIPANT_STATUS.WITHDRAWN: "participation is withdrawn", } diff --git a/hacknight/views/event.py b/hacknight/views/event.py index 24381eb..a1c015a 100644 --- a/hacknight/views/event.py +++ b/hacknight/views/event.py @@ -172,7 +172,7 @@ def event_update_participant_status(profile, event): message = message.replace("*|FULLNAME|*", participant.user.fullname) if message and g.user.email: send_email(sender=(g.user.fullname, g.user.email), to=participant.email, - subject="%s participation is %s" %(event.title, participant_status.get(participant.status)), body=text_message, html=message) + subject="%s %s" % (event.title, participant_status.get(participant.status)), body=text_message, html=message) except KeyError: pass db.session.commit()