mirror of
https://github.com/ae-utbm/sith.git
synced 2026-10-23 10:49:31 +00:00
remove unused Counter methods
`Counter.gen_token` et `Counter.get_random_barman` étaient utilisés avant la refonte du système de connexion des barmen (PR #1413), mais on a oublié de les retirer.
This commit is contained in:
1 parent
87533a7327
commit
a794f02a8d
1 file changed
-11
@@ -647,13 +647,6 @@ class Counter(models.Model):
|
||||
or user in self.sellers.all()
|
||||
)
|
||||
|
||||
def gen_token(self) -> None:
|
||||
"""Generate a new token for this counter."""
|
||||
self.token = "".join(
|
||||
random.choice(string.ascii_letters + string.digits) for _ in range(30)
|
||||
)
|
||||
self.save()
|
||||
|
||||
@cached_property
|
||||
def barmen_list(self) -> list[User]:
|
||||
"""Returns the barman list as list of User."""
|
||||
@@ -661,10 +654,6 @@ class Counter(models.Model):
|
||||
p.user for p in self.permanencies.filter(end=None).select_related("user")
|
||||
]
|
||||
|
||||
def get_random_barman(self) -> User:
|
||||
"""Return a random user being currently a barman."""
|
||||
return random.choice(self.barmen_list)
|
||||
|
||||
def update_activity(self) -> None:
|
||||
"""Update the barman activity to prevent timeout."""
|
||||
self.permanencies.filter(end=None).update(activity=timezone.now())
|
||||
|
||||
Reference in new issue
Block a user