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

DatePickerElement initial_date validation is incorrect #635

Closed
4 of 9 tasks
arturshyshko opened this issue Mar 9, 2020 · 2 comments
Closed
4 of 9 tasks

DatePickerElement initial_date validation is incorrect #635

arturshyshko opened this issue Mar 9, 2020 · 2 comments
Assignees
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented Version: 2x web-client
Milestone

Comments

@arturshyshko
Copy link

Description

While trying to pass initial_date attribute to DatePickerElement constructor, it raises

slack.errors.SlackObjectFormationError: initial_date attribute must be in format ‘YYYY-MM-DD’

even though you pass there correct date format, like "2020-03-08".

This happens because initial_date_valid for DatePickerElement uses incorrect regex for verifying date - r"\d{4}-[01][12]-[0123]\d".
This regex only matches 01, 02, 11 and 12 months.

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Reproducible in:

slackclient version: 2.2.0

python version: 3.7.0

OS version(s): MacOS Catalina Version 10.15.3

Steps to reproduce:

  1. Create DatePickerElement with action_id, placeholder and initial_date attributes (month in initial_date should be from 03 to 10);
  2. Call its to_dict() method.

Expected result:

Expected result is a dict object with action_id, initial_date, type and placeholder attributes.

Actual result:

SlackObjectFormationError is being raised.

Attachments:

image

@seratch seratch self-assigned this Mar 10, 2020
@seratch seratch added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented Priority: High labels Mar 10, 2020
@seratch
Copy link
Member

seratch commented Mar 10, 2020

Thank you very much for taking the time to report this. I've confirmed the bug and am working on the fix. I will come up with a PR for fixing this and will release a new version soon.

stevengill added a commit that referenced this issue Mar 10, 2020
Fix #635 DatePickerElement initial_date validation is incorrect
@seratch seratch added this to the 2.6.0 milestone Apr 28, 2020
@seratch
Copy link
Member

seratch commented May 15, 2020

👋 slackclient 2.6.0rc1 is out. The pre-release version contains fixes for your issue described here.
https://pypi.org/project/slackclient/2.6.0rc1/

One week later from now, we'll be releasing version 2.6.0 to PyPI.

If you have a chance, could you try the release candidate version out and let us know your feedback? Thank you very much for being patient with this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented Version: 2x web-client
Projects
None yet
Development

No branches or pull requests

2 participants