GrafeasGroup / blossom

The website. The app. The everything.
6 stars 3 forks source link

Add Ban Management to Blossom #218

Open itsthejoker opened 2 years ago

TimJentzsch commented 2 years ago

What exactly does this entail?

itsthejoker commented 2 years ago

It looks like this will involve porting the ban management over to Blossom entirely -- keeping track of bans that have variable times and such. I'm imagining that it might look like this:

class Ban(models.Model):
  user = FK(BlossomUser)
  reason = charfield()
  created = datetimefield()
  expires = datetimefield()
  banned_by = FK(BlossomUser)
  is_permanent = bool()

  def is_active(self):
    return self.is_permanent or datetime.now() > self.expires
TimJentzsch commented 2 years ago

Looks good, that would allow us to manage the bans within Slack as well. On top of that we could also introduce a computed field on the BlossomUser to indicate whether any ban is currently active for this user.

This could also integrate with a warning system that we will probably add at some point.