Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #91 from rossbruniges/no-403-on-signup

Fix a quick nit I saw when creating a profile while the challenge was open
  • Loading branch information...
commit d54f60f378ef980972f580de585f18e3314d2ecd 2 parents 36ddabc + 44a2488
@rossbruniges rossbruniges authored
View
8 gameon/users/templates/users/profile.html
@@ -44,7 +44,13 @@ <h1 class="busta shout">{{ profile.display_name }}</h1>
</ol>
{% else %}
<h2 class="announce">No entries yet</h2>
- <p>Feels like now is a great time to <a class="cta" href="{{ url('submissions.create_entry') }}">submit a game</a></p>
+ {% if request.challenge %}
+ {% if request.challenge.is_open() %}
+ <p>Feels like now is a great time to <a class="cta" href="{{ url('submissions.create_entry') }}">submit a game</a></p>
+ {% else %}
+ <p>While you wait for submissions to open ({{ request.challenge.start_date.strftime('%B %e, %Y') }}) have a look through the site, you've got some time to plan your game!</p>
+ {% endif %}
+ {% endif %}
{% endif %}
</div>
</div>
View
10 gameon/users/views.py
@@ -51,10 +51,14 @@ def edit(request, template='users/profile_edit.html'):
else:
"""
The only reason anyone will want to create an account is to
- submit a game, so take them right there
+ submit a game, so take them right there, if it's open
"""
- messages.success(request, _('<strong>Profile created.</strong> Now you can submit your first game!'))
- return redirect(reverse('submissions.create_entry'))
+ if request.challenge.is_open():
+ messages.success(request, _('<strong>Profile created.</strong> Now you can submit your first game!'))
+ return redirect(reverse('submissions.create_entry'))
+ else:
+ messages.success(request, _('<strong>Profile created.</strong>'))
+ return redirect(profile)
else:
form = form_class(instance=profile)
return render(request, template, {

0 comments on commit d54f60f

Please sign in to comment.
Something went wrong with that request. Please try again.