mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-23 00:58:40 +02:00
feat: initial commit
This commit is contained in:
@@ -21,6 +21,8 @@ from apps.users.forms import (
|
||||
)
|
||||
from apps.users.models import UserSettings
|
||||
from apps.common.decorators.demo import disabled_on_demo
|
||||
from apps.currencies.models import Currency
|
||||
from apps.accounts.models import Account
|
||||
|
||||
|
||||
def logout_view(request):
|
||||
@@ -48,6 +50,28 @@ def index(request):
|
||||
return redirect(reverse("monthly_index"))
|
||||
|
||||
|
||||
@login_required
|
||||
def setup(request):
|
||||
has_currency = Currency.objects.exists()
|
||||
has_account = Account.objects.exists()
|
||||
# return render(
|
||||
# request,
|
||||
# "users/setup/setup.html",
|
||||
# {"has_currency": has_currency, "has_account": has_account},
|
||||
# )
|
||||
if not has_currency or not has_account:
|
||||
return render(
|
||||
request,
|
||||
"users/setup/setup.html",
|
||||
{"has_currency": has_currency, "has_account": has_account},
|
||||
)
|
||||
else:
|
||||
return HttpResponse(
|
||||
status=200,
|
||||
headers={"HX-Reswap": "delete"},
|
||||
)
|
||||
|
||||
|
||||
class UserLoginView(LoginView):
|
||||
form_class = LoginForm
|
||||
template_name = "users/login.html"
|
||||
|
||||
Reference in New Issue
Block a user