Closed blag closed 8 years ago
Also, note that I fixed the logic I pointed out in #87 in this comment.
Tests are now passing for Django 1.8 and 1.9, but I haven't quite figured it out for 1.7 and 1.10. I'll get back to this in a few days.
@dominno: Besides the test failures - how does this PR look? It's lots of changes but the changes in each commit should be fairly straightforward to review.
Hi, I'm on vacation now. Will take a look at it after 14.08
Send from iPhone
Dnia 5 sie 2016 o godz. 15:47 blag notifications@github.com napisał(a):
Tests are now passing for Django 1.8 and 1.9, but I haven't quite figured it out for 1.7 and 1.10. I'll get back to this in a few days.
@dominno: Besides the test failures - how does this PR look? It's lots of changes but the changes in each commit should be fairly straightforward to review.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
No worries, thanks!
Thank you @blag for the hard work you made on this PR. Code looks great. Just you need to fix tests for django 1.10. Please let me know when you fix them and then can merge the PR.
To get all of the tests passing, I removed support for Django 1.10. I'll put that in a different PR once I get back to it, but I've already spent too much time working on this as it is. I'll put the Django 1.10 fixes I have so far in a separate branch and make a PR with that.
As it stands right now, the tests pass with Django 1.7-1.9 and all of their supported Python versions, and I'm declaring this PR done!
Please merge. 😄
I merged commits from other people and made a bunch of improvements to get
moderation
working with Django 1.9.I had the tests skip over support for Django 1.10 because this package uses a lot of private functionality in Django, I couldn't get the tests to pass with 1.10 without breaking the tests for <1.10, and I've already spent way too much time on this as it is. So Django 1.10 support will need to go in a different PR. I will try to get back to that once I have cleared a lot of other stuff in my backlog, but I can't promise anything.
Commits I
stoleincorporated from other peopleimportlib
instead of Django's backported version (which has since been deprecated and removed)Making stuff work (and work better with) Django
auto_discover
in<project>/urls.py
, move it intomoderation/apps.py
so it imports models once all apps are loaded, so moderation works with Django >= 1.9, and run it if theMODERATION_AUTODISCOVER
setting is set toTrue
auto_discover
function now does not try to importmoderation/moderators.py
because that was silently erroring out anywayNew Features
moderation_status
shortcut to models during registrationapprove()
andreject()
methods to our (new) custom queryset so we can approve and reject multipleModeratedObject
s at the same time (eg: in the admin changelist)EmailMultipleMessageBackend
using Django'ssend_mass_mail
to send email to multiple people in a single email connection and use it when approving or rejecting using a querysetOther Highlights
Choices
from django-model-utils for choice fields (we can still useSmallIntegerField
s as the database fieldDJANGO_MODERATION_MODERATORS
setting toMODERATION_MODERATORS
because theDJANGO_
part of it is redundant. If users still set it now it will still work but it will emit a warning and text informing the user how to fix it.Boring Stuff
moderation/constants.py
) so they can be imported without importingmoderation/models.py
so we can use them before the app is fully loaded