diff --git a/babybuddy/migrations/0021_alter_settings_language.py b/babybuddy/migrations/0021_alter_settings_language.py index 3333ce13..e02543be 100644 --- a/babybuddy/migrations/0021_alter_settings_language.py +++ b/babybuddy/migrations/0021_alter_settings_language.py @@ -6,13 +6,32 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('babybuddy', '0020_update_language_en_to_en_us'), + ("babybuddy", "0020_update_language_en_to_en_us"), ] operations = [ migrations.AlterField( - model_name='settings', - name='language', - field=models.CharField(choices=[('zh-hans', 'Chinese (simplified)'), ('nl', 'Dutch'), ('en-US', 'English (US)'), ('en-GB', 'English (UK)'), ('fr', 'French'), ('fi', 'Finnish'), ('de', 'German'), ('it', 'Italian'), ('pl', 'Polish'), ('pt', 'Portuguese'), ('es', 'Spanish'), ('sv', 'Swedish'), ('tr', 'Turkish')], default='en-US', max_length=255, verbose_name='Language'), + model_name="settings", + name="language", + field=models.CharField( + choices=[ + ("zh-hans", "Chinese (simplified)"), + ("nl", "Dutch"), + ("en-US", "English (US)"), + ("en-GB", "English (UK)"), + ("fr", "French"), + ("fi", "Finnish"), + ("de", "German"), + ("it", "Italian"), + ("pl", "Polish"), + ("pt", "Portuguese"), + ("es", "Spanish"), + ("sv", "Swedish"), + ("tr", "Turkish"), + ], + default="en-US", + max_length=255, + verbose_name="Language", + ), ), ] diff --git a/core/widgets.py b/core/widgets.py index b77251d3..1c21865e 100644 --- a/core/widgets.py +++ b/core/widgets.py @@ -42,7 +42,7 @@ class TagsEditor(Widget): def build_attrs(self, base_attrs, extra_attrs=None): """ - Bootstrap integration adds form-control to the classes of the widget. + Bootstrap integration adds form-control to the classes of the widget. This works only for "plain" input-based widgets however. In addition, we need to add a custom class "babybuddy-tags-editor" for the javascript file to detect the widget and take control of its contents. @@ -56,9 +56,9 @@ class TagsEditor(Widget): def get_context(self, name: str, value: Any, attrs) -> Dict[str, Any]: """ Adds extra information to the payload provided to the widget's template. - + Specifically: - - Query a list if "recently used" tags (max 256 to not cause + - Query a list if "recently used" tags (max 256 to not cause DoS issues) from the database to be used for auto-completion. ("most") - Query a smaller list of 5 tags to be made available from a quick selection widget ("quick").