summaryrefslogtreecommitdiffstats
path: root/devel/views.py
AgeCommit message (Collapse)AuthorFilesLines
2014-03-09Use localStorage to save/restore developer report filtersDan McGee1-0/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2014-02-22Generate list of reports dynamicallyDan McGee1-1/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2014-02-22Break out developer reports into a separate moduleDan McGee1-122/+15
This code was getting quite unwieldy, and wasn't very modular. Introduce a DeveloperReport class that contains the content for a single report, and utilize it to create our various report metadata and package filtering operations. Utilize these report objects in the reports view, vastly simplifying it. We don't yet dynamically generate the list of reports on the developer index page; that will be coming soon. Signed-off-by: Dan McGee <dan@archlinux.org>
2014-02-22Change long out-of-date report to 30 daysDan McGee1-2/+2
At the request of barthalion. This bumps the report from currently showing 36 packages to 109 packages. Signed-off-by: Dan McGee <dan@archlinux.org>
2014-01-26Revert "Change old packages report from two years to one year"Dan McGee1-2/+2
This reverts commit 8d3a1a1c504a70dd23d36c3ed5be0ebcd2f7a86d. Turns out we aren't updating packages quite as often anymore. There are currently 1900+ packages in the repos built more than one year ago. Signed-off-by: Dan McGee <dan@archlinux.org> Conflicts: devel/views.py
2013-11-26Merge branch 'django-1.6'Dan McGee1-3/+3
2013-11-08Ensure user has a profile created when they go to edit itDan McGee1-3/+4
Use get_or_create, even though it leaves a bad taste in my mouth. The first user created won't have a profile becuase Django doesn't create one for users created at the command line, causing an exception when the user goes to edit it. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-11-07Drop old base64-ed PGP signature columnDan McGee1-1/+1
We've moved onto bytes only now. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-11-07Django 1.6 upgrade, deprecation cleanupDan McGee1-2/+2
PendingDeprecationWarning: commit_on_success is deprecated in favor of atomic. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-22Move stats portion of developer dashboard to separate viewDan McGee1-6/+15
This stuff is all below the fold when the page first loads, and adds a good amount of loading time to the developer dashboard. Split it out, where it will be wired back and hooked up via an AJAX insertion in a future commit. Both parts work standalone as is in this commit. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-17Various minor code cleanups and fixesDan McGee1-1/+1
Most of these were suggested by PyCharm, and include everything from little syntax issues and other bad smells to dead or bad code. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-27Use user.userprofile rather than user.get_profile()Dan McGee1-2/+2
The get_profile() function is deprecated as of Django 1.5. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-03Use DeveloperKey model on package page and reportsDan McGee1-10/+23
This introduces the new model to the package page so subkey signings show up as attributed to the original developer. We also teach the mismatched signatures report to recognize all keys and subkeys of a given developer, cutting down on some of the bogus results. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-12-31Mark todolist packages as removed rather than deleting themDan McGee1-1/+1
This makes it easier to see the progression of a todolist and its contents easier since we are no longer losing the data. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-12-28Convert to using new todolist models everywhereDan McGee1-5/+7
This is a rather widespread set of changes converting usage to the new todo list and todo list package model recently introduced. The data migration is not included in this commit. After this commit, the old model should no longer be referenced anywhere. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-11-16Use python set comprehension syntax supported in 2.7Dan McGee1-2/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-25Exclude inactive developers in maintainer countDan McGee1-1/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-25Add a new column to developer repo statsDan McGee1-0/+5
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-15Add JS-based filtering to the developer reportsDan McGee1-0/+4
This can use the todolist filtering functions we made more generic in a previous commit. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-05Split devel forms out of devel/views.pyDan McGee1-96/+10
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-09Add flag requests to developer last action calculationDan McGee1-1/+7
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-25Replace deprecated direct_to_template() with render() shortcutDan McGee1-8/+7
Now that Django actually provides a concise way to use a RequestContext object without instantiating it, we can use that rather than the old function-based generic view that worked well to do the same. Additionally, these function-based generic views will be gone in Django 1.5, so might as well make the move now. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-25Remove custom utc_now() function, use django.utils.timezone.now()Dan McGee1-6/+6
This was around from the time when we handled timezones sanely and Django did not; now that we are on 1.4 we no longer need our own code to handle this. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-06-08Use 3 decimal places for showing compression ratioDan McGee1-1/+1
Otherwise there are too many grouped under each value. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-19Switch to usage of new Depend objectDan McGee1-3/+3
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-12Change to new time access methods in pgpdump codeDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-02Ensure order_by default value is cleared when using distinct()Dan McGee1-2/+4
Otherwise the queryset returns nonsensical results. I find the design of this less than obvious but so be it; we can ensure the results work regardless of a default ordering on the model. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-30Add a "last action" column to developer clocks pageDan McGee1-7/+36
This allows people to easily see if a developer has done anything recently that we can easily grab a date for. Obviously this doesn't include all sources of activity, so the list of things checked is clearly stated at the top. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-27Dev dashboard performance improvementDan McGee1-5/+10
Rather than one query per cell in the arches and repos statistics tables, we can group these together up front using Django annotations. This means we only need one query per table. In my local instance with all of the staging repos imported, this reduces the total query count on this page from 56 to 26, a rather marked improvement. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-27Incomplete-only todolists optimizationDan McGee1-2/+1
We can push this down to the database if we know in advance we only need the incomplete lists. This helps our call on the developer dashboard quite a bit; the time of the single query in question drops from >1300ms to around 40ms. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-20UserProfile model and fields shuffleDan McGee1-1/+2
Move this model into the devel/ application, and move the PGPKeyField which is used only by these models into the application as well. This involves updating some old migrations along the way to ensure we don't reference a field class that no longer exists. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-09Change old packages report from two years to one yearDan McGee1-2/+2
Now that all packages are getting more attention, we can shorten the time period on the report to a shorter date range. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07Add a mismatched signatures developer reportDan McGee1-2/+21
This finds odd signatures in our repositories, which includes signature times not matching with build dates, different signer and packager, etc. We enhance our user lookup helper class to look up users by PGP key. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-24Make all datetime objects fully timezone awareDan McGee1-20/+13
This is most of the transition to Django 1.4 `USE_TZ = True`. We need to ensure we don't mix aware and non-aware datetime objects when dealing with datetimes in the code. Add a utc_now() helper method that we can use most places, and ensure there is always a timezone attached when necessary. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-21Ensure clocks Expires header works in 59th minute of hourDan McGee1-2/+2
This was a rather careless oversight on my part. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-08Exclude all compressed manpagesDan McGee1-1/+4
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-13Reduce false positives returned by uncompressed manpages reportDan McGee1-4/+6
Explicitly exclude '.html' files from the report. This fixes the issue noted in FS#28372. We also add `is_directory=False` to both the manpage and info page queries; this could help the database come up with a better plan. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-05Adjust page and content caching lengths and decoratorsDan McGee1-4/+10
Remove never_cache from many places now that we don't actually need it since we aren't caching by default. Adjust our cache_function decorator times be shorter values, and also randomize them a bit to make cache invalidations not all line up. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-12PyLint suggested cleanupsDan McGee1-9/+9
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-09Prefilter packages when looking up uncompressed man/info pagesDan McGee1-19/+23
This vastly speeds up the reports if you just want to look at your own packages and not the complete list, especially if the list of packages you maintain is relatively short. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-03Exclude Latin Name from developer profile formDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-21Better support for non-latin full namesDan McGee1-1/+1
Add a 'latin_name' field to the user profile so we can better support those developers with names in non-Latin scripts, and yet still show a Latin name as necessary on the developer profile page. This field only shows up if populated. Also, use consistent sorting everywhere- rather than using username, always use first_name and last_name fields. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-11Show relevant signoffs on dashboardDan McGee1-0/+5
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-03Use UTC now everywhereDan McGee1-3/+3
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-05Allow developer index to work with a non-authenticated userDan McGee1-1/+6
This is not the normal case given the decorator on the view, but during testing and development it is sometimes useful so others don't have to log in over a non-secure connection to check things out. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-28Add a bad compression ratio reportDan McGee1-1/+18
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-24Add (hidden) ability to search by last packagerDan McGee1-0/+2
This is used from the developer dashboard to add a new column to the stats of # of packages for a given developer where they were the last to do the packaging. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15Refactor common select_related into manager methodDan McGee1-2/+2
For a Package object query, we almost always did .select_related('arch', 'repo). Refactor this into the manager as a 'normal()' method so we can avoid sprinkling the same logic everywhere. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-13Add a long out-of-date developer reportDan McGee1-1/+6
This shows packages that have been marked out of date for more than 90 days in the repos. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-02Add a PGP key field on the dev profileDan McGee1-0/+7
Signed-off-by: Dan McGee <dan@archlinux.org>