Created database class.
Tidied app.py so that it only contains controller logic. Added error handling for if number of entrants exceeds number of possible identifiers Updated test coverage to test for all identifiers, as well as error case
This commit is contained in:
@@ -16,10 +16,15 @@
|
||||
<div class="row">
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-8 content-div">
|
||||
<p>You have been entered into the competition to brew a <strong>{{ brew_name }}</strong>, which will be judged at the meeting in <strong>{{ brew_month }}</strong>.</p>
|
||||
<p>To make sure your beer isn't easily identifiable, most people tend to use brown bottles of either 330ml or 500ml size. You probably don't want to put your own label on the bottle!</p>
|
||||
<br/>
|
||||
<div class="alert alert-success lead" role="alert"> <span class="glyphicon glyphicon-tags" aria-hidden="true"></span> Please mark all of your bottlecaps with the following identifier: <strong>{{ identifier }}</strong></div>
|
||||
{% if error == None %}
|
||||
<p>You have been entered into the competition to brew a <strong>{{ brew_name }}</strong>, which will be judged at the meeting in <strong>{{ brew_month }}</strong>.</p>
|
||||
<p>To make sure your beer isn't easily identifiable, most people tend to use brown bottles of either 330ml or 500ml size. You probably don't want to put your own label on the bottle!</p>
|
||||
<br/>
|
||||
<div class="alert alert-success lead" role="alert"> <span class="glyphicon glyphicon-tags" aria-hidden="true"></span> Please mark all of your bottlecaps with the following identifier: <strong>{{ identifier }}</strong></div>
|
||||
{% else %}
|
||||
<p>Unfortunately it has not been possible to enter you into the competition at this time</p>
|
||||
<div class="alert alert-danger lead" role="alert"> {{ error }} </div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user