Used preferred name in volunteer signup.
This commit is contained in:
parent
e7b25ea0c6
commit
ecfbfcd53e
2 changed files with 113 additions and 5 deletions
|
|
@ -69,11 +69,7 @@ func (app *App) handlePublicSignup(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
// Find or create participant by email.
|
||||
name := body.PreferredName
|
||||
if body.TicketName != "" {
|
||||
name = body.TicketName
|
||||
}
|
||||
participant, _, err := app.upsertParticipant(body.Email, name)
|
||||
participant, _, err := app.upsertParticipant(body.Email, body.PreferredName)
|
||||
if err != nil {
|
||||
writeError(w, "internal error", http.StatusInternalServerError)
|
||||
return
|
||||
|
|
@ -166,8 +162,13 @@ func (app *App) handleConfirmEmail(w http.ResponseWriter, r *http.Request) {
|
|||
if len(tickets) > 0 {
|
||||
ticketID = tickets[0].ID
|
||||
} else {
|
||||
tkName := vol.TicketName
|
||||
if tkName == "" {
|
||||
tkName = vol.PreferredName
|
||||
}
|
||||
stub, err := app.createTicket(Ticket{
|
||||
ParticipantID: vol.ParticipantID,
|
||||
Name: tkName,
|
||||
Source: "manual",
|
||||
})
|
||||
if err == nil {
|
||||
|
|
@ -228,8 +229,13 @@ func (app *App) openShiftSignups() {
|
|||
if len(tickets) > 0 {
|
||||
ticketID = tickets[0].ID
|
||||
} else {
|
||||
tkName := v.TicketName
|
||||
if tkName == "" {
|
||||
tkName = v.PreferredName
|
||||
}
|
||||
stub, err := app.createTicket(Ticket{
|
||||
ParticipantID: v.ParticipantID,
|
||||
Name: tkName,
|
||||
Source: "manual",
|
||||
})
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue