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

Disallow mutually exclusive arguments boolean and empty_value in admin display decorator #2211

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

flaeppe
Copy link
Member

@flaeppe flaeppe commented Jun 6, 2024

Trying to capture the following ValueError raised by Django: https://github.com/django/django/blob/2719a7f8c161233f45d34b624a9df9392c86cc1b/django/contrib/admin/decorators.py#L59-L63

e.g.

from django.contrib.admin.decorators import display

@display(boolean=True, empty_value="empty")
def f() -> None: ...

Raises

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "django/contrib/admin/decorators.py", line 60, in decorator
    raise ValueError(
ValueError: The boolean and empty_value arguments to the @display decorator are mutually exclusive.

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

Successfully merging this pull request may close these issues.

1 participant