Conversation
raynaldlao
left a comment
There was a problem hiding this comment.
Faut modifier certains fichiers mais dans l'ensemble c'est ok
| page_number=page_number, | ||
| total_pages=total_pages | ||
| ) | ||
| return render_template("index.html", articles=articles, page_number=page_number, total_pages=total_pages) |
There was a problem hiding this comment.
Faut le remettre comme avant, c'est à cause de ruff ça.
Quand tu fais :
render_template("index.html", articles=articles, page_number=page_number, total_pages=total_pages)
Si tu as un petit PC, tu seras obligé de scroll à droite.
Si tu fais ça par contre :
render_template(
"index.html",
articles=articles,
page_number=page_number,
total_pages=total_pages
)
| content=content, | ||
| author_id=user_id | ||
| ) | ||
| article_service.create_article(title=title, content=content, author_id=user_id) |
There was a problem hiding this comment.
Idem : Faut le remettre comme avant, c'est à cause de ruff ça.
| title=title, | ||
| content=content | ||
| ) | ||
| article = article_service.update_article(article_id=article_id, user_id=user_id, role=role, title=title, content=content) |
There was a problem hiding this comment.
Idem : Faut le remettre comme avant, c'est à cause de ruff ça.
| user_id=user_id, | ||
| role=role | ||
| ): | ||
| if article_service.delete_article(article_id=article_id, user_id=user_id, role=role): |
There was a problem hiding this comment.
Idem : Faut le remettre comme avant, c'est à cause de ruff ça.
| user_id=session[SessionKey.USER_ID], | ||
| content=content | ||
| ): | ||
| if comment_service.create_comment(article_id=article_id, user_id=session[SessionKey.USER_ID], content=content): |
There was a problem hiding this comment.
Idem : Faut le remettre comme avant, c'est à cause de ruff ça.
app/services/comment_service.py
Outdated
| comment_written_account_id=user_id, | ||
| comment_content=content | ||
| ) | ||
| new_comment = Comment(comment_article_id=article_id, comment_written_account_id=user_id, comment_content=content) |
There was a problem hiding this comment.
Idem : Faut le remettre comme avant, c'est à cause de ruff ça.
app/services/comment_service.py
Outdated
| .options(joinedload(Comment.comment_author)) | ||
| .order_by(Comment.comment_posted_at.asc()) | ||
| ) | ||
| query = select(Comment).where(Comment.comment_article_id == article_id).options(joinedload(Comment.comment_author)).order_by(Comment.comment_posted_at.asc()) |
There was a problem hiding this comment.
Idem : Faut le remettre comme avant, c'est à cause de ruff ça.
app/services/registration_service.py
Outdated
| existing_username = self.session.execute(existing_username_query).scalar_one_or_none() | ||
|
|
||
| if existing_username: | ||
| return "This username is already taken." |
There was a problem hiding this comment.
Pourquoi c'est pas un résultat en flash ?
There was a problem hiding this comment.
Pour respecter le Principe de Responsabilité Unique (SRP — SOLID)
app/services/registration_service.py
Outdated
| existing_email = self.session.execute(existing_email_query).scalar_one_or_none() | ||
|
|
||
| if existing_email: | ||
| return "This email is already taken." |
There was a problem hiding this comment.
Idem : Pourquoi c'est pas un résultat en flash ?
There was a problem hiding this comment.
Pour respecter le Principe de Responsabilité Unique (SRP — SOLID)
tests/conftest.py
Outdated
| "TESTING": True, | ||
| "SECRET_KEY": env_vars.test_secret_key | ||
| }) | ||
| flask_app.config.update({"TESTING": True, "SECRET_KEY": env_vars.test_secret_key}) |
There was a problem hiding this comment.
Idem : Faut le remettre comme avant, c'est à cause de ruff ça.
1666ea0 to
5a393c5
Compare
5a393c5 to
8270b79
Compare
Ajout de la fonctionnalité de création de compte
Cette Pull Request a son importance étant donné que nous créions les comptes en base de données pour les tests jusque là.
L'objectif était de pouvoir créer un compte directement via l'application.
Résumé des changements
Validation Technique
pytest).pyright.ruff.Contenu de la PR
app/controllers/registration_controller.py: Modification du Contrôleur du compte qui permet via le bouton du formulaire d'être redirigé.app/services/registration_service.py: Logique métier de la création du compte.app/templates/registration.html: Formulaire HTML de création de compte.app/models/account_model.py: Modification du modèle pour prendre en compte l'unicité du email et l'impossibilité de créer un compte sans email.