mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-03-26 11:21:24 +01: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(
|
||||
queryset=Account.objects.filter(
|
||||
is_archived=False,
|
||||
),
|
||||
is_archived=False,
|
||||
),
|
||||
label=_("Default Account"),
|
||||
widget=TomSelect(clear_button=False, group_by="group"),
|
||||
required=False,
|
||||
@@ -160,9 +160,9 @@ class UserSettingsForm(forms.ModelForm):
|
||||
"date_format",
|
||||
"datetime_format",
|
||||
"number_format",
|
||||
"default_account",
|
||||
HTML('<hr class="hr my-3" />'),
|
||||
"start_page",
|
||||
"default_account",
|
||||
HTML('<hr class="hr my-3" />'),
|
||||
"volume",
|
||||
FormActions(
|
||||
@@ -177,10 +177,6 @@ class UserSettingsForm(forms.ModelForm):
|
||||
"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):
|
||||
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"),
|
||||
)
|
||||
default_account = models.ForeignKey(
|
||||
"accounts.Account", on_delete=models.SET_NULL,
|
||||
"accounts.Account",
|
||||
on_delete=models.SET_NULL,
|
||||
verbose_name=_("Default account"),
|
||||
help_text=_("Selects the account by default when creating new transactions"),
|
||||
blank=True,
|
||||
null=True,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user