-
Notifications
You must be signed in to change notification settings - Fork 29
feat(admin): add action to trigger sync repos #1295
Conversation
🚨 Sentry detected 2 potential issues in your recent changes 🚨Lower risk findings
Did you find this useful? React with a 👍 or 👎 |
This new action triggers the "sync_repos" for the selected owner from the admin dashboard. Would have been helpful for me today. (only tested through the unit tests)
fd3b3d2 to
06d3fe1
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. 📢 Thoughts on this report? Let us know! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1295 +/- ##
=======================================
Coverage 96.29% 96.30%
=======================================
Files 488 488
Lines 16995 17007 +12
=======================================
+ Hits 16366 16378 +12
Misses 629 629
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
| level=messages.SUCCESS, | ||
| ) | ||
| History.log( | ||
| Owner.objects.get(ownerid=owner.ownerid), |
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.
this would just be owner, right?
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 wasn't sure, cause there is an OwnerAdmin class (line 593) so I wasn't sure if the queryset is of OwnerAdmins or Owners :E
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.
SO I copied what impersonate_owner does :P
| def refresh_owner(self, request, queryset): | ||
| if queryset.count() != 1: | ||
| self.message_user( | ||
| request, "You must refresh exactly one Owner.", level=messages.ERROR |
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 it should be trivially possible to also support multiple-select.
This new action triggers the "sync_repos" for the selected owner from the admin dashboard. Would have been helpful for me today.
(only tested through the unit tests)