BaboucheOne / BuggyBot

Simply a customs agent
5 stars 1 forks source link

Add registered decorator #27

Open BaboucheOne opened 1 month ago

BaboucheOne commented 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.

BaboucheOne commented 1 month ago

Why not using has_role decorator ?