Skip to content

Commit

Permalink
Fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
danielengelhardt committed Jul 30, 2023
1 parent 19ae4db commit de63421
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions DSTBundesliga/apps/dstffbl/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def profile(request):
season_user = None
season_registration = None
message = ""
season_data = {}
season_data = None
registration_open = is_registration_open()

try:
Expand Down Expand Up @@ -223,12 +223,15 @@ def profile(request):
message = "Deine Daten wurden erfolgreich gespeichert!"

else:
form = ProfileForm(data={
"sleeper_username": season_data.dst_player.display_name,
"email": season_data.user.email,
"possible_commish": season_data.possible_commish,
"region": season_data.region
})
if season_data:
form = ProfileForm(data={
"sleeper_username": season_data.dst_player.display_name,
"email": season_data.user.email,
"possible_commish": season_data.possible_commish,
"region": season_data.region
})
else:
form = ProfileForm()

return render(request, "dstffbl/profile.html", {
"season": season,
Expand Down

0 comments on commit de63421

Please sign in to comment.