Skip to content

Commit

Permalink
"Updated freelancer registration redirect, removed duplicate freelanc…
Browse files Browse the repository at this point in the history
…er_dashboard function, and removed try-except block in freelancer_dashboard function."
  • Loading branch information
NexusGKSoftwares committed Dec 3, 2024
1 parent 141b81c commit 13c6b82
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
Binary file modified db.sqlite3
Binary file not shown.
Binary file modified freelancer/__pycache__/views.cpython-313.pyc
Binary file not shown.
12 changes: 2 additions & 10 deletions freelancer/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def register(request):
user = User.objects.create_user(username=username, email=email, password=password1)
login(request, user)
messages.success(request, "Registration successful!")
return redirect('dashboard') # Adjust this as per your application logic
return redirect('freelancer_dashboard') # Adjust this as per your application logic
except Exception as e:
messages.error(request, f"Error: {str(e)}")
return redirect('register')
Expand Down Expand Up @@ -61,15 +61,7 @@ def freelancer_login(request):
def freelancer_dashboard(request):
return render(request, 'freelancer/dashboard.html')

@login_required
def freelancer_dashboard(request):
try:
freelancer = Freelancer.objects.get(user=request.user)
except Freelancer.DoesNotExist:
# Handle case where the freelancer object is not found
return redirect('register') # Redirect to freelancer registration page

return render(request, 'freelancer/dashboard.html', {'freelancer': freelancer})


@login_required
def freelancer_edit_profile(request):
Expand Down

0 comments on commit 13c6b82

Please sign in to comment.