Skip to content

[BUG] Submit Training Records rejects valid callsigns #89

@asherrobinson

Description

@asherrobinson

Contact Details

wm@nyartcc.org

What happened?

When using the API to submit training records, requests are rejected if they don't match an (unnecessarily restrictive) regex. This regex does not currently account for all valid position identifiers. The most recent example from our facility is as follows:

Jul 13, 2022 
Type Checkout
Position NY_66_CTR
Progression ★★★★
Venue Sweatbox
Dur. 60
Mvmts. 20

I believe the relevant code is in App\Http\Controllers\API\v2\TrainingController, in a number of places in the various record creation/modification methods. I'd suggest modifying this regex to allow all valid callsigns, so that valid training records stop getting rejected.

What endpoint was being used?

POST https://api.vatusa.net/v2/user/{cid}/training/record

What error response was returned (if applicable)?

{"data":{"status":"error","msg":"Invalid position."},"testing":false}

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions