Modify AND and OR permission operands to have the ability to use custom messages#6502
Modify AND and OR permission operands to have the ability to use custom messages#6502samitnuk wants to merge 6 commits intoencode:masterfrom
AND and OR permission operands to have the ability to use custom messages#6502Conversation
bcffbac to
1d77243
Compare
|
@ozandogrultan Many thanks for your comments. I have updated this PR. |
|
@samitnuk wrote
I think for this case, we should add the class MyCustomPermission(permissions.BasePermission):
message = _("you are not active")
inverted_message = _("you are active")and use it for class NOT:
def __init__(self, op1):
self.op1 = op1
self.message = getattr(self.op1, 'inverted_message', None)but this is incorrect for double negative. |
|
Hi, @iproha94. Thank you for your review. I will check your comments and make updates asap. |
ab99187 to
12e0009
Compare
|
@ozandogrultan, @auvipy, @iproha94 please review the updated PR. Many thanks. |
|
Is this being merged? |
12e0009 to
09979d6
Compare
|
Any plans to to get this merged?? |
|
I am running into this issue currently. Is this in the roadmap to get merged? |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Same issue here. |
|
let see how it works on current CI |
auvipy
left a comment
There was a problem hiding this comment.
I think this enhancement also needs documentation updates
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
refs #6427
AND- If failed permission has a message, it will be returned.OR- If both permissions will be failed:a) if both permissions have messages - will be returned one message combined from two messages;
b) if only one permission (from both failed) has a message - this message will be returned (I suppose this is better then return the default one).
NOT- If failed permission has amessage_invertedattribute, it will be returned. (@iproha94 thanks for this suggestion).