Prevent creating CSV uploads without a service area
This commit is contained in:
parent
f2ea1367e2
commit
2f61b224de
2 changed files with 7 additions and 0 deletions
|
|
@ -107,6 +107,10 @@ func postUploadDiscard(ctx context.Context, r *http.Request, u platform.User, f
|
|||
type FormUploadPool struct{}
|
||||
|
||||
func postUploadPoolFlyoverCreate(ctx context.Context, r *http.Request, u platform.User, f FormUploadPool) (string, *nhttp.ErrorWithStatus) {
|
||||
// If the organization we're uploading to doesn't have a service area, we can't process the upload correctly
|
||||
if !u.Organization.HasServiceArea() {
|
||||
return "", nhttp.NewErrorStatus(http.StatusConflict, "Your organization does not yet have a service area")
|
||||
}
|
||||
uploads, err := file.SaveFileUpload(r, "csvfile", file.CollectionCSV)
|
||||
if err != nil {
|
||||
return "", nhttp.NewError("Failed to extract image uploads: %s", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue