other problems. I started looking at the tests in this update. This update I
spent fixing the tests to work with my new code.
--\ mediagoblin/db/migration_tools.py
--| Merging from ticket 679
--\ mediagoblin/db/migrations.py
--| Added unique constraint to Privilege.privilege_name
--\ mediagoblin/db/models.py
--| Deleted vestigial Privilege.is_admin_or_moderator method
--\ mediagoblin/templates/mediagoblin/moderation/user.html
--| Add a `Ban User` / `UnBan User` for admin
--\ mediagoblin/test/test_api.py
--| Fixed test with my new changes
--\ mediagoblin/test/test_auth.py
--| Try to fix test, still having problems
--\ mediagoblin/test/test_modelmethods.py
--| Wrote my first test for the User.has_privilege method
--\ mediagoblin/test/test_modelmethods.py
--| Fixed test with my new changes
--\ mediagoblin/test/test_sqlmigrations.py
--| Merging from ticket 679
--\ mediagoblin/test/tools.py
--| Editted add_fixture_user to allow for privileges rather than active column
Revert "This patch checks for libs instead of programs in configure.ac for sqlite3 and postgesql."
This reverts commit 26da3271f6e6a880c0418998d5a4e5e71081e1f7.
People will need to switch that setting in their mediagoblin.ini too.
Make sure we RELEASE NOTE this.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
- Make sure Exceptions are pickleable (not sure if this was not the
case but this is the pattern as documented in the celery docs.
- Don't create a task_id in the GMG code, but save the one
implicitely created by celery.
- Don't create a task-id directory per upload. Just store queued uploads
in a single directory (this is the most controversial change and might
need discussion!!!)
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Instead of redirecting directly to user's home. Makes the flow for mass or just
a few deletions easier. For really large deletions it would still make sense to
have a dedicated view, but this is still way better then losing context by
jumping back to the home view.
Signed-off-by: Alon Levy <alon@pobox.com>
I made was I added the method has_privilege (which takes a variable amount of
unicode privilege names as an argument) to the User model. This method allowed
for much cleaner checks as to whether or not a user has a privilege. Other-
wise, I also made it impossible for moderators to punish admins. I created a
new url path and three new pages for Users to look at filed reports and the
code of conduct for the mg instance.
=== Made reports on admins not resolvable by moderators:
--\ mediagoblin/moderation/views.py
--\ mediagoblin/templates/mediagoblin/moderation/report.html
=== Created new files for the new pages:
--\ mediagoblin/meta/__init__.py
--\ mediagoblin/meta/routing.py
--\ mediagoblin/meta/views.py
--\ mediagoblin/templates/mediagoblin/meta/code_of_conduct.html
--\ mediagoblin/templates/mediagoblin/meta/reports_details.html
--\ mediagoblin/templates/mediagoblin/meta/reports_panel.html
--\ mediagoblin/routing.py
--\ mediagoblin/static/css/base.css
=== Replaced vestigial methods of checking a user's privilege with the more
====== effective method has_privilege(u'privilege_name'):
--\ mediagoblin/db/models.py
--| Added in the has_privilege method to the User class
--\ mediagoblin/db/migrations.py
--\ mediagoblin/db/models.py
--\ mediagoblin/decorators.py
--\ mediagoblin/edit/lib.py
--\ mediagoblin/edit/views.py
--\ mediagoblin/gmg_commands/users.py
--\ mediagoblin/moderation/views.py
--\ mediagoblin/templates/mediagoblin/base.html
--\ mediagoblin/templates/mediagoblin/user_pages/collection.html
--\ mediagoblin/templates/mediagoblin/user_pages/media.html
--\ mediagoblin/templates/mediagoblin/user_pages/user.html
--\ mediagoblin/templates/mediagoblin/utils/collection_gallery.html
--\ mediagoblin/user_pages/views.py
=== Minor UI changes
--\ mediagoblin/templates/mediagoblin/moderation/report_panel.html
--\ mediagoblin/templates/mediagoblin/moderation/user.html
=== Other Bugs:
--\ mediagoblin/tools/response.py
--\ mediagoblin/db/migrations.py
This reverts commit f67611fb485b5a84cedc62b73beb1e551e8cb934.
For some reason, generating a slug here throws an integrity error during
a query when there is a duplicate slug.
It does this in real time with a 500ms lag by using a timer. Initially I tried the onChange handler but you need to lose focus for that to process. The javascript timer is only invoked if the add comment button is pressed. A request is only sent if the comment box is not empty and the current value is not the same as the last value.