mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
chore: require email address for subscriptions
This commit is contained in:
@@ -181,6 +181,10 @@ func (h *SettingsHandler) actionUpdateUser(w http.ResponseWriter, r *http.Reques
|
||||
return http.StatusBadRequest, "", "invalid parameters"
|
||||
}
|
||||
|
||||
if user.Email == "" && user.HasActiveSubscription() {
|
||||
return http.StatusBadRequest, "", "cannot unset email while subscription is active"
|
||||
}
|
||||
|
||||
user.Email = payload.Email
|
||||
user.Location = payload.Location
|
||||
user.ReportsWeekly = payload.ReportsWeekly
|
||||
|
||||
Reference in New Issue
Block a user