Commit Graph

26 Commits

Author SHA1 Message Date
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
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
a8500c3853 Add migrations for all existing models
When migrating on existing installations, run the

python manage.py migrate --fake-initial

command.
2016-05-14 19:49:12 +02:00
217f9ef62a Fix model warnings and deprecations
1. ForeignKey with unique -> OneToOneField
2. IPAddressField -> GenericIPAddressField
3. Fix fields with default=datetime.now() which gives server start time,
   not the insert time (clearly this default was never used, and the
   field was always explicitly set, but it should still not be incorrectly
   defined)
2016-05-14 19:49:12 +02:00
63d920ab5f Fix long-standing incorrect select_related parameter
This was broken before, but older django versions didn't notice it was
wrong and just ignored it. 1.8 throws an error, so now is a good time to
fix it.
2016-05-14 19:49:12 +02:00
350b936e58 Prefix cross-application imports with pgweb
As required by the new project layout.
2016-05-14 19:49:12 +02:00
8058accee0 Get rid of PgModel, replacing it with simple signals
We were already using signals for everything except delete, and even
in our old version of django the delete signal exists (it didn't exist
when this code was first written).

Django doesn't really like models to be OOP like this, so keeping PgModel
would cause issues with upcoming changes in django 1.8. Using simple functions
is easier, and the actual functionality is replicated straight off.
2016-03-07 21:41:45 +01:00
98f79d39c2 Allow professional services to be searchable in the admin
Enables an admin to search over professional services, and additionally
filter the services by whether or not they are approved.
2014-04-30 08:13:37 -04: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
bfe49e44f0 One more spot missed when renaming organisation field 2012-06-29 14:13:03 +02:00
4cbb54a1d7 Rename organisation->org in ProfessionalService model
This is requied to support notifications, and good for consistency
in general.
2012-06-26 14:34:26 +02:00
3af6029727 Add help texts refering to the organisation list on forms that take an organisation field
For those who don't read the introduction page under my account, per request
from Dave.
2012-01-20 15:15:08 +01:00
b609de5559 Remove submitter field from professional services
The rest of the code already dealt with profservs attached to organisations,
but the existance of tihs field causded the validation to reject any
updates since this field is wrong. Instead, create a verify_submitter()
function that checks the permissions on the organisation.

This fixes #98
2011-11-27 17:50:40 +01:00
5bcbf1253e All purge_urls must be rooted, since we add ^ at the beginning 2011-11-27 13:31:20 +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
965767e992 Add edit for professional services 2011-08-24 16:56:00 +02:00
adabe319ae Each organisation should only be able to have one professional service 2011-08-24 16:38:28 +02:00
39c4018dd6 Set verbose name for fields in professional services 2011-08-24 16:38:04 +02:00
f92709d2a6 Implement basic varnish purging
This allows all models inherited from PgModel to specify which
URLs to purge by either setting a field or defining a function
called purge_urls, at which point they will be purged whenever
the save signal is fired.

Also implements a form under /admin/purge/ that allows for manual
purging. This should probably be extended in the future to show
the status of the pgq slaves, but that will come later.

Includes a SQL function that posts the expires to a pgq queue. For
a local deployment, this can be replaced with a simple void function
to turn off varnish purging.
2011-06-14 19:48:48 +02:00
22f5578c29 Add support for generating sitemap.
Each module now contains a struct.py file that will return all
the URLs that it can generate (yes, this is a small break of the
abstraction of url.py, but we've broken that elsewhere as well),
and also which search-engine-weight (0.1-1.0) that this URL should
be given.
2010-09-28 16:12:13 +02:00
e7f437c0e9 Remove leftover from copy/paste 2010-09-28 15:45:41 +02:00
37c79c7882 Make professional services also use organisations 2010-02-25 17:03:12 +01:00
90b758c247 A first very basic import.
Contains basic functionality, and an import of most of the static content
from the old site.

There is still plenty more to do...
2009-09-14 14:39:25 +02:00