Commit Graph

57 Commits

Author SHA1 Message Date
5ffe6c389c Re-work moderation of submitted items
This includes a number of new features:

* Move some moderation functionality into shared places, so we don't
  keep re-inventing the wheel.
* Implement three-state moderation, where the submitter can edit their
  item and then explicitly say "i'm done, please moderate this now".
  This is currently only implemented for News, but done in a reusable
  way.
* Move moderation workflow to it's own set of URLs instead of
  overloading it on the general admin interface. Admin interface remains
  for editing things, but these are now separated out into separate
  things.
* Do proper stylesheet clearing for moderation of markdown fields, using
  a dynamic sandboxed iframe, so it's not ruined by the /admin/ css.
* Move moderation email notification into dedicated moderation code,
  thereby simplifying the admin subclassing we did which was in some
  places quite fragile.
* Reset date of news postings to the date of their approval, when
  approved. This avoids some annoying ordering issues.
2020-09-10 14:52:41 +02:00
b405302d97 Avoid returning HttpServerError for things not server errors
With the new django, alerts are raised for everything with status 500,
not juse exceptions. This put a light on a number of places where we
were returning 500 server error code for things that are not actually
server errors. Some should be a regular 200 ok with an error message,
and others should be a permissions error.
2020-04-04 14:43:27 +02:00
4f63d6c8a4 Another encoding fix for yum 2019-01-26 16:46:40 +01:00
b74fa2146a Fix datatype and encoding for yum spider 2019-01-26 16:45:59 +01:00
c136b8858f Fix sorting in file browser 2019-01-26 16:23:10 +01:00
a10eb6420b More generic changes from 2to3 2019-01-26 16:19:26 +01:00
7547b6f766 Update syntax for relative imports 2019-01-26 16:19:26 +01:00
142f0805c2 Update to new style exception catching 2019-01-26 16:19:26 +01:00
00ab822ea8 Fix deprecated comparison structs 2019-01-17 21:19:57 +01:00
0883ac6423 Fix whitespace and indentation, per pep8 2019-01-17 20:47:43 +01:00
87237f6536 Tabs, meet your new overlords: spaces
In a quest to reach pep8, use spaces to indent rather than tabs.
2019-01-17 15:35:39 +01:00
0c6099e236 Remove unused imports 2018-06-29 13:40:04 +02:00
487d86bee3 Fix that HttpServerError now takes a request as parameter 2018-03-10 10:54:13 -05:00
fd37389a3b Replace NavContext and render_to_response with render_pgweb
render_to_response does not work on newer django, so it needs to be
replaced. And using a speicfic context actually overcomplicates things,
it's easier to just use a wrapper function. For those cases where we
don't need NavContext, just use render() (the new shortcut function from
django), which also removes the need to use RequestContext.
2018-03-10 10:38:11 -05:00
2f52c4f7c4 Clean up whitespace in primary Python / HTML files
Clean up the whitespace in the primary Python / HTML files in
order to make it easier to apply changes going forward.
2017-11-29 08:21:35 -05:00
4697ceb007 Automate supported versions in yum download scripts
We do this by always spidering every repo rpm available (since the ftp
server doesn't know about supported versions), and then filtering which
versions are shown in the dropdown instead. Given the small number of
versions of either kind, this doesn't make a material difference in the
size of the files anyway.
2017-10-09 12:51:33 +02:00
8e8903bd48 Make yum download instructions more dyanamic
Using the crawled data, propulate dropdown boxes with versions and
platforms, to be able to show simpler instructions of exactly which
commands to use to install using the yum repository.
2017-06-08 13:06:39 +02:00
d09fde9ba3 Add function to spider reporpms from the yum repo
The ftp server can then submit a list (and structure) of which platforms
are supported for yum downloads, which can then later (in a separate
commit) be used to generate a nicer download for yum repo rpms.
2017-05-24 13:48:04 -04:00
9d99280bad Ensure we don't have any trailing slashes when matching paths in the ftp site pickle. 2016-12-06 13:58:25 +00:00
92dcb0a23d Handle symlinks properly in the directory browser.
This change properly handles symlinks by expanding any it finds in the path
and issuing a redirect to the canonical location.

Whilst we're here, display links as such on the pages, sort directory listings
so the parent link is always at the top, and avoid unnecessary redirects caused
by missing /'s on URLs.
2016-11-30 17:51:33 +09:00
7fc34e9eaf Replace login_required decorator with a validating one
This one will validate that the url is under /accounts/, which is
the only part we are going to be excluding from caching once we
move the website to https-only.
2016-05-24 21:14:34 +02:00
3c089cd09a Remove SSL decorators and middleware
The site is now served regardless of SSL, and assumes that the webserver
or web cache ensures that things rae always SSL.
2016-05-24 21:13:00 +02:00
79350c87d9 Remove old mirror selection code and data
This has not been used for many years now, so let's get rid of
it to save some maintenance.
2016-05-14 21:42:38 +02:00
cb1ff8bbf1 Substitute "request.raw_post_data" with the new attribute "request.body" 2016-05-14 14:27:25 -04:00
da812e682b mimetype is now called content_type 2016-05-14 19:49:12 +02:00
856dbd31a2 Update for new transaction handling in newer django versions 2016-05-14 19:49:12 +02:00
70726c8359 Remove dead code 2015-12-17 17:34:31 +01:00
d26da86f65 Remove commented-out references to old clickthrus table
This table is now dropped from the master, so remove it from here
so that nobody tries to re-use that code...
2015-10-06 14:33:10 +02:00
233e37e327 move downloads through the file browser to https by default 2014-11-03 21:05:06 +01:00
1be7fe8e0c the sorting in the ftpbrowser for source tarballs has always been odd,
this is a small hack to make it better for the most common usecases...
2014-02-28 21:51:50 +01:00
137d4295f3 Remove unused code causing warnings 2014-01-01 16:41:27 +01:00
94e3b79dce Replace wildcard imports with explicit ones 2014-01-01 16:33:52 +01:00
756aa6ffbe Clean up imports
Remove unused imports and some other completely unused code.
2014-01-01 15:42:30 +01:00
23a7c88172 Add a new field to the StackBuilder catalog to specify a manifest URL.
The manifest URL (which is optional) will point to an XML file that
describes the command line, option file and environment options that
can be passed to an installer, to allow automated or non-interactive
deployment tools to figure out what info is required to run an
installer and how to pass it to it.

Requires SQL:

ALTER TABLE downloads_stackbuilderapp ADD COLUMN manifesturl character varying(500);
UPDATE downloads_stackbuilderapp SET manifesturl = '';
ALTER TABLE downloads_stackbuilderapp ALTER COLUMN manifesturl SET NOT NULL;
2013-08-20 14:49:39 +01:00
1229faca8a Exclude the ftp info upload page from CSRF checks
This is a pure PUT from a trusted IP, so it fails with 403 with the
CSRF middleware.
2013-06-16 18:32:30 +02:00
a64835ef93 Try not to crash the ftp browser when there is a directory named README 2012-10-29 21:53:05 +01:00
355b187d78 Make stackbuilder dependencies into a comma separated textfield
The "true dependencies" usign db relationships were too strict for
reality - multiple entries can have the same textid, and that's what
we need to depend on. Resolving it for platform is handled in the
StackBuilder client.

This update requires the following SQL to be run in the database:
DROP TABLE downloads_stackbuilderapp_dependencies;
ALTER TABLE downloads_stackbuilderapp ADD COLUMN txtdependencies varchar(1000) NOT NULL DEFAULT '';
ALTER TABLE downloads_stackbuilderapp ALTER COLUMN txtdependencies DROP DEFAULT;

Closes #167
2012-07-11 11:42:18 +02:00
1678c93db6 Oops, missed a number of references to publisher :O 2012-06-26 14:59:35 +02:00
758a721405 Allow for the ftpsite pickle to be uploaded via https
Previously this had to be rsynced outside of the website. By allowing the
upload here, and automatically purging the data from varnish, we will reach
"almost instant" updates of the ftp site structure on the web.
2011-12-06 19:13:32 +01:00
d0d7519301 Don't cause exception on calls to the old redirector without required parameters
Instead, show a general error, the way we do if the parameter exists
but has an invalid value.
2011-12-06 09:54:49 +01:00
42cc273025 Use correct classname for DoesNotExist exception 2011-12-01 15:45:25 +01:00
898ff65116 Include the secondary platform in the applications-v2.xml file. 2011-11-29 09:58:56 +00:00
2e07b3b30f Don't try to log into a nonexisting clickthrus table for now 2011-11-27 19:08:05 +01:00
74d8bdd647 Make account editing forms redirect back to list of objects
Instead of like previously, redirect back to the list of object
types.
2011-11-09 22:16:13 +01:00
47c09a5a57 Don't try to be smart with mirrors, just use our master mirrors
Still leaves the old templates around in case we want to go back on this,
as well as keeps the pure redirector service around so accesses from
things like stackbuilder don't stop working.
2011-11-06 11:45:46 +01:00
91d6cce18f Render server errors with a nicer template 2011-08-17 20:28:03 +02:00
d0ec914ee1 Typo fix - use date, not type, to indicate date. 2011-08-11 16:03:21 +02:00
bc56595241 Ensure that [Parent Directory] link ends up at the top of directory listings
Locale-aware sorting ignores the initial [, and sorts it at P. Instead,
sort before we add the parent link, and just insert it at the beginning.
2011-07-12 12:18:02 +01:00
2942c2832a Use new get_client_ip() function instead of using REMOTE_ADDR. 2010-06-17 14:56:26 +02:00
521920542b Get the information for the ftp browser from a file that is generated
on the ftp server, instead of crawling the directoreis directly. This
removes the requirement to sync almost 10Gb worth of ftp site onto the
web server...

The pickle file for this is currently around 1Mb, so it's not a huge
burden on the server. If it grows larger in the future, we may want to
re-think this and split it up, or put it in a database format or something
like that.
2010-06-10 14:46:16 +02:00