mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-13 00:02:53 +02:00
refactor: move help_text to model definition
This commit is contained in:
@@ -120,8 +120,8 @@ class UserSettingsForm(forms.ModelForm):
|
|||||||
|
|
||||||
default_account = forms.ModelChoiceField(
|
default_account = forms.ModelChoiceField(
|
||||||
queryset=Account.objects.filter(
|
queryset=Account.objects.filter(
|
||||||
is_archived=False,
|
is_archived=False,
|
||||||
),
|
),
|
||||||
label=_("Default Account"),
|
label=_("Default Account"),
|
||||||
widget=TomSelect(clear_button=False, group_by="group"),
|
widget=TomSelect(clear_button=False, group_by="group"),
|
||||||
required=False,
|
required=False,
|
||||||
@@ -160,9 +160,9 @@ class UserSettingsForm(forms.ModelForm):
|
|||||||
"date_format",
|
"date_format",
|
||||||
"datetime_format",
|
"datetime_format",
|
||||||
"number_format",
|
"number_format",
|
||||||
"default_account",
|
|
||||||
HTML('<hr class="hr my-3" />'),
|
HTML('<hr class="hr my-3" />'),
|
||||||
"start_page",
|
"start_page",
|
||||||
|
"default_account",
|
||||||
HTML('<hr class="hr my-3" />'),
|
HTML('<hr class="hr my-3" />'),
|
||||||
"volume",
|
"volume",
|
||||||
FormActions(
|
FormActions(
|
||||||
@@ -177,10 +177,6 @@ class UserSettingsForm(forms.ModelForm):
|
|||||||
"translation_link": '<a href="https://translations.herculino.com" target="_blank">translations.herculino.com</a>'
|
"translation_link": '<a href="https://translations.herculino.com" target="_blank">translations.herculino.com</a>'
|
||||||
}
|
}
|
||||||
|
|
||||||
self.fields["default_account"].help_text = _(
|
|
||||||
"Selects the account by default when creating new transactions"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class UserUpdateForm(forms.ModelForm):
|
class UserUpdateForm(forms.ModelForm):
|
||||||
new_password1 = forms.CharField(
|
new_password1 = forms.CharField(
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# Generated by Django 5.2.9 on 2026-02-16 01:32
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('accounts', '0016_account_untracked_by'),
|
||||||
|
('users', '0024_usersettings_default_account'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='usersettings',
|
||||||
|
name='default_account',
|
||||||
|
field=models.ForeignKey(blank=True, help_text='Selects the account by default when creating new transactions', null=True, on_delete=django.db.models.deletion.SET_NULL, to='accounts.account', verbose_name='Default account'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -511,8 +511,10 @@ class UserSettings(models.Model):
|
|||||||
verbose_name=_("Start page"),
|
verbose_name=_("Start page"),
|
||||||
)
|
)
|
||||||
default_account = models.ForeignKey(
|
default_account = models.ForeignKey(
|
||||||
"accounts.Account", on_delete=models.SET_NULL,
|
"accounts.Account",
|
||||||
|
on_delete=models.SET_NULL,
|
||||||
verbose_name=_("Default account"),
|
verbose_name=_("Default account"),
|
||||||
|
help_text=_("Selects the account by default when creating new transactions"),
|
||||||
blank=True,
|
blank=True,
|
||||||
null=True,
|
null=True,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user