Skip to content

Commit feba54a

Browse files
committed
fix: problema al guardar los articulos
Se elimina el problema del articulo duplicado, además para articulos nuevos, se asigna por defecto el board del usuario. Closes #38 Refs: #2 Refs: #3
1 parent 9be0398 commit feba54a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: newswriter/views/default.py

+2
Original file line numberDiff line numberDiff line change
@@ -464,11 +464,13 @@ def articleEndPoint(pkid):
464464
# this is a new one and request.json['uuid'] is mandatory
465465
current_app.logger.debug("Creating a new Article")
466466
article = Article(
467+
id=pkid,
467468
headline=request.json['headline'],
468469
credit_line=request.json['creditline'],
469470
excerpt=request.json['summary'],
470471
content=json.dumps(request.json['content']),
471472
author_id=current_user.id,
473+
board_id=Board.getUserBoard(current_user).name
472474
)
473475
article.keywords = request.json['keywords']
474476
db.session.add(article)

0 commit comments

Comments
 (0)