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

Upgrade django filter #1005

Merged
merged 3 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ephios/api/access/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ def to_python(self, value):

class AccessTokenForm(forms.ModelForm):
description = forms.CharField(
label=_("Description"),
widget=forms.TextInput(attrs={"placeholder": _("What is this token for?")}),
required=True,
)
scope = TokenScopesChoiceField(
label=_("Scope"),
choices=[
(scope, mark_safe(f"<code>{scope}</code>: {description}"))
for scope, description in get_scopes_backend().get_all_scopes().items()
Expand All @@ -74,6 +76,7 @@ class AccessTokenForm(forms.ModelForm):
help_text=_("For security reasons, only select the scopes that are actually needed."),
)
expires = forms.SplitDateTimeField(
label=_("expiration date"),
widget=CustomSplitDateTimeWidget,
required=False,
)
Expand Down
2 changes: 1 addition & 1 deletion ephios/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
CSP_INCLUDE_NONCE_IN = ["style-src"]

# django-crispy-forms
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
CRISPY_ALLOWED_TEMPLATE_PACKS = ("bootstrap5",)
CRISPY_TEMPLATE_PACK = "bootstrap5"
CRISPY_FAIL_SILENTLY = not DEBUG

Expand Down
Loading