Require code in season.
This commit is contained in:
@@ -103,9 +103,11 @@ class Season:
|
||||
try:
|
||||
end = datetime.date.fromisoformat(end)
|
||||
except Exception:
|
||||
raise INVALID_STR.format('end')
|
||||
raise AttributeError(INVALID_STR.format('end'))
|
||||
|
||||
code = form.get('code', None)
|
||||
if not code:
|
||||
raise AttributeError(INVALID_STR.format('code'))
|
||||
|
||||
self = cls(id, game, description, start, end, code)
|
||||
return self
|
||||
|
||||
@@ -7,7 +7,7 @@ create table if not exists season
|
||||
description text,
|
||||
start text,
|
||||
end text,
|
||||
code text
|
||||
code text not null
|
||||
);
|
||||
|
||||
create unique index if not exists season_id_uindex
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="code"
|
||||
value="{{ model['code'] }}">
|
||||
value="{{ model['code'] }}"
|
||||
required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="game">Game Name</label>
|
||||
|
||||
Reference in New Issue
Block a user