diff --git a/config/__pycache__/settings.cpython-311.pyc b/config/__pycache__/settings.cpython-311.pyc index c5d4013..262f1a5 100644 Binary files a/config/__pycache__/settings.cpython-311.pyc and b/config/__pycache__/settings.cpython-311.pyc differ diff --git a/config/settings.py b/config/settings.py index 1c26d7f..f0a537c 100644 --- a/config/settings.py +++ b/config/settings.py @@ -183,6 +183,9 @@ if EMAIL_USE_SSL: DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' +LOGIN_REDIRECT_URL = 'dashboard' +LOGOUT_REDIRECT_URL = 'home' + from django.utils.translation import gettext_lazy as _ LANGUAGES = [ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index c979782..60cc7da 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/views.py b/core/views.py index 256a0f9..e9f193f 100644 --- a/core/views.py +++ b/core/views.py @@ -36,7 +36,7 @@ def register(request): @login_required def dashboard(request): - profile = request.user.profile + profile, created = Profile.objects.get_or_create(user=request.user) if profile.role == 'SHIPPER': my_shipments = Shipment.objects.filter(shipper=request.user).order_by('-created_at') return render(request, 'core/shipper_dashboard.html', {'shipments': my_shipments}) diff --git a/media/trucks/lorry2.jfif b/media/trucks/lorry2.jfif new file mode 100644 index 0000000..3cc1118 Binary files /dev/null and b/media/trucks/lorry2.jfif differ