-
Notifications
You must be signed in to change notification settings - Fork 2
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
Track number of visits on workspace invitation page #571
base: master
Are you sure you want to change the base?
Conversation
we do this for shortened URLs gooey-server/url_shortener/routers.py Line 24 in 6573a92
more detailed tracking is added there with |
Should we call it Tracking the visitor click info would be interesting too for building dashboards, but can leave out for first |
@devxpy FYI, pushed the renaming |
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.
PR Summary
Added visit tracking functionality to workspace invitations by introducing a 'clicks' field to track page views and displaying this information in the admin interface.
- Added
clicks
field toWorkspaceInvite
model with default=0 in migration0007_workspaceinvite_clicks.py
- Inconsistent naming between 'clicks' field in model/migration and 'visits' references in views.py needs alignment
- Added clicks counter to
WorkspaceInviteAdmin
list_display and readonly_fields for visibility - Optimized save() call in accept() method by specifying update_fields parameter
- Uses Django's F() expression in views.py for race-condition-safe counter increments
💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!
4 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile
readonly_fields = [ | ||
"clicks", | ||
"auto_accepted", | ||
"has_expired", | ||
"created_at", | ||
"updated_at", | ||
] |
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.
logic: clicks field added to readonly_fields but not included in WorkspaceInviteInline.readonly_fields - could lead to inconsistent behavior
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.
@nikochiko thoughts?
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.
PR Summary
(updates since last review)
This PR continues the implementation of workspace invitation tracking functionality. Here's a focused summary of the recent changes:
- Updated
invitation_page
function inworkspaces/views.py
to increment the clicks counter using F() expressions for atomic updates - Maintained consistent field naming by using 'clicks' instead of 'visits' throughout the codebase
- Implemented race-condition-safe counter increments using Django's F() expression
- Added proper field tracking in admin interface for monitoring invitation clicks
The changes are straightforward and maintain good database practices by using atomic updates. No major concerns with the implementation.
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
please squash and merge too, for nicer git history |
Q/A checklist
You can visualize this using tuna:
To measure import time for a specific library:
To reduce import times, import libraries that take a long time inside the functions that use them instead of at the top of the file:
Legal Boilerplate
Look, I get it. The entity doing business as “Gooey.AI” and/or “Dara.network” was incorporated in the State of Delaware in 2020 as Dara Network Inc. and is gonna need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Dara Network Inc can use, modify, copy, and redistribute my contributions, under its choice of terms.