Skip to content

Commit 162aad0

Browse files
fix
1 parent 44dc2d3 commit 162aad0

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

app.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ class Like(db.Model):
3737
user_id=db.Column(db.Integer)
3838
edit_id=db.Column(db.Integer)
3939

40-
class Tag(db.Model):
41-
id=db.Column(db.Integer,primary_key=True)
42-
problem_id=db.Column(db.Integer)
43-
tag=db.Column(db.String(64))
44-
user_id=db.Column(db.Integer)
45-
4640
#コンテスト名に含まれる空白などを取り除く
4741
def _normalize_contestname(contestname):
4842
if isinstance(contestname, str):
@@ -115,7 +109,7 @@ def submit():
115109
params = {
116110
'title': request.form.get('title'),
117111
'description': request.form.get('description'),
118-
'contestname': _normalize_contestname(request.form.get('contestname')),
112+
'contestname': _normalize_contestname(request.form.get('problem_id')),
119113
'url': request.form.get('url'),
120114
'like':int(0),
121115
'user_image_url': current_user.user_image_url,

templates/contest.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@ <h4 class="card-header text-white bg-info col-10" data-toggle="collapse" data-ta
9999
<br>
100100
<input type="text" placeholder="URL" name="url" style="width:535px" />
101101
<br>
102-
<textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea> {%if contestname==None%}
103-
<button type="submit" class="btn btn-info" name="contestname" value="{{request.args.get('contestname ',' ')}}">投稿</button> {%else%}
104-
<button type="submit" class="btn btn-info" name="contestname" value="{{contestname}}">投稿</button>{%endif%}
102+
<textarea placeholder=" 解説文 " name="description" style="white-space:pre; word-wrap:break-word;" rows=15 cols=57></textarea>
103+
<button type="submit" class="btn btn-info" name="problem_id" value="{{problem_id}}">投稿</button>
105104

106105
</form>
107106
</div>

0 commit comments

Comments
 (0)