feat: add All Transactions as valid start page

This commit is contained in:
Herculino Trotta
2024-10-27 21:54:21 -03:00
parent bfd0cc45a3
commit 0a5d93027e
2 changed files with 20 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
# Generated by Django 5.1.2 on 2024-10-28 00:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0009_alter_usersettings_start_page'),
]
operations = [
migrations.AlterField(
model_name='usersettings',
name='start_page',
field=models.CharField(choices=[('MONTHLY_OVERVIEW', 'Monthly Overview'), ('YEARLY_OVERVIEW', 'Yearly Overview'), ('NETWORTH', 'Net Worth'), ('ALL_TRANSACTIONS', 'All Transactions')], default='MONTHLY_OVERVIEW', max_length=255, verbose_name='Start page'),
),
]

View File

@@ -30,6 +30,8 @@ def index(request):
return redirect(reverse("yearly_index"))
elif request.user.settings.start_page == UserSettings.StartPage.NETWORTH:
return redirect(reverse("net_worth"))
elif request.user.settings.start_page == UserSettings.StartPage.ALL_TRANSACTIONS:
return redirect(reverse("transactions_all_index"))
else:
return redirect(reverse("monthly_index"))