-
Notifications
You must be signed in to change notification settings - Fork 10
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
Log whenever a user logs in to a client #207
base: master
Are you sure you want to change the base?
Conversation
"""Log which client users login to""" | ||
# take an arbitrary non-individual organization, since most users will have one org | ||
organization = user.organizations.filter(individual=False).first() | ||
plan = None if organization is None else organization.plan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth trying to figure out if a user belongs to any org with a premium plan here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly? I didn't devote too much time thinking about it as I assume the vast majority of users are only in one org. Depending on how accurate we need to be, it might be worth doing something smarter
@@ -217,3 +217,38 @@ def is_hub_eligible(self): | |||
| Q(groups__hub_eligible=True) | |||
| Q(parent__hub_eligible=True) | |||
).exists() | |||
|
|||
|
|||
class LoginLog(models.Model): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a plan to truncate this table at some point when we have two billion logins?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ideally we would have somewhere we can put this data where we can easily analyze it. Is that just here and we build some visualizations on top? Possibly try putting it in datasette? Or use a third party tool that would let us analyze it? I am also not sure if we want to just truncate after a certain amount of time or if we want to archive old data for historical purposes
How can team members get data out for analysis? |
Log every time someone uses Squarelet to log in to a client site (MuckRock, DocumentCloud, Big Local, etc)