Open BaboucheOne opened 1 month ago
We need decorators to ensure that the student can access certains routes. For example :
@registered def speak_to_bot_when_registered(self): pass @unregistered def speak_to_bot_when_unregistered(self): pass
We can only call the method speak_to_bot_when_registered when the student is registered. The decorator will handle the logic for us.
speak_to_bot_when_registered
Why not using has_role decorator ?
We need decorators to ensure that the student can access certains routes. For example :
We can only call the method
speak_to_bot_when_registered
when the student is registered. The decorator will handle the logic for us.