A lot of strings in the migrations needed a change from b' to ' to work
after the migration to py3, but this was forgotten in the big patch.
No actual changes included in this patch.
A lot of strings in the migrations needed a change from b' to ' to work
after the migration to py3, but this was forgotten in the big patch.
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.
Over the years, contributors come and go and we have many cases now where
the contributor's email address which we have is not valid. As we really
don't want to show incorrect information on the webpage, allow contributor
email addresses to be blank for cases where we've discovered that the email
address is no longer valid.
We have so many users now that loading these forms take forever.
Instead, implement a textbox with autocomplete using django-selectable,
which will not load the whole list of users at once.
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.
Only for users that are already listed under /community/contributors/,
make it possible to edit this data, so we don't have to track it manually.
For obvious reasons, we don't allow editing of the "contributor level"
field...
This also changes the contributors model to send a notification to
the slaves list whenever a contributor record is changed, so we can do
post-moderation if necessary.
This will be used to allow users to edit their own contributor records.
Requires SQL:
ALTER TABLE contributors_contributor add column "user_id" integer REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED;
CREATE INDEX "contributors_contributor_user_id" ON "contributors_contributor" ("user_id");
UPDATE contributors_contributor set user_id=(select id from auth_user where auth_user.email=contributors_contributor.email) where contributors_contributor.email is not null;
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.
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.