Conversation
…after values without ss (seconds)
…UT_FORMATS) for pycontw-2020.proposals.disable.after & catch ValidationError
…o the form that will be submitted
…rom data loss on invalid `proposals.disable.after` value
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1204 +/- ##
==========================================
+ Coverage 74.03% 74.44% +0.40%
==========================================
Files 81 81
Lines 3062 3115 +53
==========================================
+ Hits 2267 2319 +52
- Misses 795 796 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
please fix the translation entries with fuzzy marks
| datetime_input_format += ['%Y-%m-%dT%H:%M:%S', '%Y-%m-%dT%H:%M'] | ||
| value = value.strip() | ||
| # Try to strptime against each input format. | ||
| for format in datetime_input_format: |
There was a problem hiding this comment.
it's better not to mutate the input arguments
| datetime_input_format += ['%Y-%m-%dT%H:%M:%S', '%Y-%m-%dT%H:%M'] | |
| value = value.strip() | |
| # Try to strptime against each input format. | |
| for format in datetime_input_format: | |
| value = value.strip() | |
| # Try to strptime against each valid format | |
| valid_formats = datetime_input_format + ['%Y-%m-%dT%H:%M:%S', '%Y-%m-%dT%H:%M'] | |
| for format in valid_formats: |
| current_review_stages_setting[tag] = value | ||
|
|
||
|
|
||
| def date_preprocess(datetime_input_format, value): |
There was a problem hiding this comment.
give the arg a plural name if it's a list
| def date_preprocess(datetime_input_format, value): | |
| def date_preprocess(datetime_input_formats: list[str], value: str) -> datetime.datetime | None: |
| function Call_for_Proposals() { | ||
| proposals_creatable.checked = true; |
There was a problem hiding this comment.
nit: we typically use camel case for class/variable names in javascript
| function Call_for_Proposals() { | |
| proposals_creatable.checked = true; | |
| function CallForProposals() { | |
| proposalsCreatable.checked = true; |
| padding: $panel-body-padding; | ||
| color: black; |
There was a problem hiding this comment.
ensure same indent style
| padding: $panel-body-padding; | |
| color: black; | |
| padding: $panel-body-padding; | |
| color: black; |
| return url | ||
|
|
||
|
|
||
| def review_stages(request): |
There was a problem hiding this comment.
nit: consider rewriting it into a class-based view, as it seems to be one of our conventions
| value = reg.get(key, '') | ||
| update_current_review_stages_setting(tag, value, current_review_stages_setting) | ||
|
|
||
| if request.method == 'POST': |
There was a problem hiding this comment.
what are the allowed methods of this api? can i call with PUT, PATCH, GET?
| </div> | ||
| </li> | ||
| <li class="panel-title list-group-item"> | ||
| timezone |
There was a problem hiding this comment.
What's the purpose of allowing updating the timezone?
Aren't we switching the stages based AoE (Anywhere on Earth) time? The README of the review stages does not mention timezone too.
| if "." in tag: | ||
| tag = tag.replace(".", "_") | ||
| current_review_stages_setting[tag] = value |
There was a problem hiding this comment.
to relieve the maintainers/developers from the burden to remember the conversion logic, can we align the naming of the reg keys and context pass to the template?
| date_time_obj = date_preprocess(DATETIME_INPUT_FORMATS, request.POST[tag]) | ||
| if date_time_obj is None: | ||
| messages.error(request, 'Please input valid date format : " + "%Y-%m-%dT%H:%M') | ||
| value = None |
There was a problem hiding this comment.
why save None on error? maybe we can raise exception and respond with 400 instead?
|
Types of changes
Description
Steps to Test This Pull Request
Steps to reproduce the behavior:
Expected behavior
Related Issue
#782
More Information