alex / alex/django-admin-histograms

django_histogram.utils.Histogram assert statement is invalid

Open
#2 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
106
Forks
9
PR merge metrics
No merged PRs in 30d

Description

```
assert months or days, 'You must pass either months or days, not both.'
```

The above line check to see that months or days is in the list of args. It doesn't actually check that only one is used. This would work instead:

```
assert months or days, "You must have months or days"
assert not (months and days), "You must pass either months or days, not both"
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.