Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with values for event_status in get_events() #114

Open
GregSutcliffe opened this issue Mar 22, 2021 · 0 comments
Open

Problems with values for event_status in get_events() #114

GregSutcliffe opened this issue Mar 22, 2021 · 0 comments

Comments

@GregSutcliffe
Copy link
Contributor

There's a few issues in get_events() handling of event_status. Firstly, the docs suggests that the default for this field is upcoming but the code has it as a vector of statuses.

Using the code defaults results in a 403 for my test groups:

> get_events('Ansible-Atlanta')
Error in fun(api_path = "Ansible-Atlanta/events", event_status = "upcoming,cancelled,draft,past,proposed,suggested",  : 
  Forbidden (HTTP 403).

While overriding to the documented default works:

> get_events('Ansible-Atlanta',event_status='past')
Downloading 24 record(s)...
# A tibble: 24 x 22
   id     name   created             status time               
   <chr>  <chr>  <dttm>              <chr>  <dttm>             
 1 22168… "Ansi… 2015-04-07 22:35:38 past   2015-05-20 00:30:00
...

I suspect this is because some event types are protected and can only be seen if you're logged in as that group owner. However, avoiding this by specifying a custom list of statuses returns a different error:

> get_events('Ansible-Atlanta',event_status=c('past','upcoming'))
Error in match.arg(event_status) : 'arg' must be of length 1

I think this is a typo. match.arg needs a set of valid choices, and we don't specify any in get_events() - but we do specify them in the .check_event_status() function. Should get_events be calling the internal function?

That doesn't help me understand why the function default of event_status = c("upcoming", "cancelled", "draft", "past", "proposed", "suggested") passes the match.arg check though, or why a single override works either ... what am I missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant