-
Notifications
You must be signed in to change notification settings - Fork 144
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
Signals and Documentation #287
Comments
I completely agree but at the same time I'm looking for contributor that would reintroduce these (and document this feature) standing on what already documented in django and what would be the best practices for djangosaml2 I'm looking for contributor for that, would you like to join in this? |
Yes we (Webu) can join it. I think there are 2 approaches (not exclusive):
I think both approaches have advantages and depend on what you want to do. For exemple, it's simpler to have multiple independant app's which add custom code via signals. But for dependant apps, it's stronger to use hooks via multi Mixins inheritance for final Backend / View. What do you think about it ? |
regardings signals: regarding hooks we have two strategies:
as alternative we could move to a better generalizable model, similar to this: here we have some registered hooks (that could be also external django apps). https://github.com/UniversitaDellaCalabria/uniCMS/blob/main/src/cms/contexts/signals.py or adding the calls in the class methods. Probably the settings HOOKS would be the smartest thing if you agree |
Hi @DylannCordel Which approach would you prefer? |
Hi @peppelinux IMHO, be able to inherit some classes (views, backends...) which are designed to add some code execution at specific moment to change/add some behaviours is a must have. In the other hand, signals are also great to perform some actions which are independant from what SAML does, but just need to be executed at the right moment and get access to informations. Concerning the signal registration via a setting, I'm not sure. I would prefer that third-party apps stay autonomous to register receivers once they are added in In conclusion, I think both approaches are complementary (code designed to be overrided + signals) and will allow developpers to get a way for every thing they want to do. I'll create a wip PR with just the documentation and if you are ok with what is proposed, I'll implement it. |
This has been handled in exactly the wrong way. Removing signalling callers without removing the signals themselves means there are chumps like me doing upgrades and some time later finding out that their whole system has fallen apart and not being able to find out why until they start digging around in ACS view code. Why doesn't But please, just do something. If you remove the signals it will break code and that is a good thing! Means developers get the opportunity to notice this and fix things. Or you could put deprecation warnings (or throw errors) in the |
Nice shot @oliwarner this issue and the relative PR seems to be in pause. We can include and document this feature in the next release 1.4.0 of djangosaml2 if you agree |
@peppelinux It's hard to see how to best unravel 343c7e4 If signals are going to carry on existing, reverting most of it seems most sensible. If they're not, I do think deleting |
I'll proceed deleting signals.py as soon as possible |
anyway @oliwarner we have this very good work from @DylannCordel here before deleting singlas.py I'd like to give a change to this work. having said this I think that we should decide together if going ahead with signals and complete that PR or clean up the source tree from signals.py |
Definitely. I really appreciated signals as a way to hook this behaviour. They were much easier than inheriting a CBV, overriding methods within that, pointing an extra URL to your new overridden view in such a way to override the old one. That's all a pain in the bum we can do without (unless you really want to). Signals are way better. My problem was the current state of things. While signals exist and aren't being called, there will be djangosaml2 users whose listeners aren't being actioned and important business logic calls aren't happening. The PR from @DylannCordel looks good. The signature on |
@oliwarner would you like to give a patch on this and complete the WiP of @DylannCordel with your very reasonable ideas? |
Hi,
Since pre_user_save and post_authenticated are not any more used, I think it should be great to delete signals.py to avoid a working website wich was using signals to performs some actions ?
The text was updated successfully, but these errors were encountered: