-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor les transactions pour pas raiser dedans #4605
Conversation
is_visible = self.object.is_visible | ||
if can_read and ((is_author and is_visible) or request.user.has_perm('forum.change_post')): | ||
return super(PostEdit, self).dispatch(request, *args, **kwargs) | ||
raise PermissionDenied |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ça vaudrait presque le coup d'avoir notre propre context_manager qui raise PermissionDenied si on n'a pas fait de return à la fin du with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est une idée. Bon là c'est explicite et simple, c'est pas plus mal.
zds/notification/models.py
Outdated
@@ -117,6 +115,7 @@ def send_email(self, notification): | |||
try: | |||
msg.send() | |||
except SMTPException: | |||
LOG.error('Failed sending mail for %s', self, exc_info=True) | |||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
du coup le pass est inutile.
58c7824
to
fe1f7f4
Compare
fe1f7f4
to
6517807
Compare
Apparament pas de conflit insoluble. Néanmoins un rebase est nécessaire pour faire passer travis sur la nouvelle base de code. |
tu peux faire un petit rebase stp? |
tu pourras rebase ça @vhf ? |
6517807
to
70dbcd1
Compare
@artragis C'est fait. |
Backporté depuis #4389
QA
python manage.py migrate
etyarn test
)