aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin
Commit message (Collapse)AuthorAgeFilesLines
* I did some more code-keeping in this commit. I added a lot of documentation, sotilly-Q2013-09-0315-97/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that most of my functions do indeed have effective docstrings. I also changed the decorators so that they imply eachother in a logical way. I also modified the one decorator get_media_comment_by_id to be more usable with the variable urls of mediagoblin.user_pages.views:file_a_report. I also noticed a few tests had broken, so I went through them and fixed them up, finding that mostly there were problems in my actual writing of the tests. I also did a few other small tasks such as creating a new User method to check whether or not a User is ban- -ned. =============================================================================== Added in documentation =============================================================================== --\ mediagoblin/db/models.py --\ mediagoblin/decorators.py --\ mediagoblin/moderation/forms.py --\ mediagoblin/moderation/tools.py --\ mediagoblin/moderation/views.py --\ mediagoblin/user_pages/lib.py =============================================================================== Rearranged decorators to be more efficient =============================================================================== --\ mediagoblin/decorators.py --| Made it so that user_not_banned is encapsulated in require_active_login --| Made it so that require_active_login is encapsulated in user_has_privilege --| Changed get_media_comment_by_id into get_optional_media_comment_by_id. It | now returns valid code if the MediaComment id is absent. This makes it pos- | -sible to use this decorator for the function: | mediagoblin.user_pages.views:file_a_report --\ mediagoblin/user_pages/views.py --| Replaced the mediagoblin.user_pages.views:file_a_comment_report with the | decorator mentioned above --\ mediagoblin/user_pages/routing.py ----------------------------------------------------------- | took out unnecessary @user_not_banned decorators | ----------------------------------------------------------- --\ mediagoblin/submit/views.py --\ mediagoblin/user_pages/views.py =============================================================================== Fixed broken tests =============================================================================== --\ mediagoblin/tests/test_auth.py --\ mediagoblin/tests/test_privileges.py --\ mediagoblin/tests/test_submission.py =============================================================================== Fixed broken code =============================================================================== --\ mediagoblin/tools/response.py =============================================================================== Other Tasks =============================================================================== --\ mediagoblin/db/models.py --| Added in User.is_banned() method --\ mediagoblin/decorators.py --| Utitilized User.is_banned() method in the user_not_banned decorator --\ mediagoblin/moderation/views.py --| Made it impossible for an admin to ban themself. --| Got rid of a vestigial print statement --\ mediagoblin/templates/mediagoblin/base.html --| Made it so the top panel does not show up for users that are banned. --\ mediagoblin/templates/mediagoblin/moderation/user.html --| Rearranged the javascript slightly ===============================================================================
* I've moved on to one of the last phases of my work! Now I'm just checking offtilly-Q2013-09-0312-204/+351
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | items from my last to-do list. The biggest change in this commit is that I made the moderation reports panel sortable via get request. I also added in page nu- mbers so that more than 10 reports can be viewed. I'm hoping to go from here to make a search page. Aside from that, there were only a few other changes I made this time. I fixed two bugs in my code. I copy-ed and pasted function mediagoblin.user_pages.views:media_preview_comment which I must've deleted ear- -lier in a merge. And I moved some of the javascript I was using in the modera- -tion templates into it's own seperate .js file. =============================================================================== Made the moderation reports panel view sortable =============================================================================== --\ mediagoblin/moderation/forms.py --\ mediagoblin/moderation/views.py --\ mediagoblin/templates/mediagoblin/moderation/report_panel.html --\ mediagoblin/templates/mediagoblin/moderation/user.html --| Made `<user> report history` into a link that automatically shows all open | and closed reports on <user>. =============================================================================== Grabbed some code from master that I accidentally deleted in a merge =============================================================================== --\ mediagoblin/user_pages/views.py =============================================================================== Moved javascript away from templates into its own file =============================================================================== --\ mediagoblin/static/js/setup_report_forms.js --\ mediagoblin/templates/mediagoblin/moderation/report.html --\ mediagoblin/templates/mediagoblin/moderation/user.html =============================================================================== Cleared trailing white space =============================================================================== --\ mediagoblin/templates/mediagoblin/moderation/media_panel.html --\ mediagoblin/moderation/tools.py --\ mediagoblin/templates/mediagoblin/meta/terms_of_service.html --\ mediagoblin/templates/mediagoblin/moderation/report_panel.html --\ mediagoblin/templates/mediagoblin/user_pages/media.html --\ mediagoblin/tests/test_modelmethods.py =============================================================================== Small fixes =============================================================================== --\ mediagoblin/templates/mediagoblin/moderation/report.html --| Fixed a link so that it points to the correct user page --\ mediagoblin/templates/mediagoblin/user_pages/media.html --| Fixed a bug that crashed this page when a guest visitted it (because | request.user is None)
* This is a quick commit. I gave admins the ability to ban or unban userstilly-Q2013-08-2911-23/+395
| | | | | | | | | straight from the moderation.users_detail page. I also changed the UserBan.expiration_date type from DateTime into Date. I also began work on the Terms of Service, pulled from another website (which will be cited clearly before I'm done). I added new tests as well for the ban/unbanning. Lastly, I added a few `user_not_banned` decorators to relevant views, so banned users cannot access any pages.
* This was a big commit! I included lots of documentation below, but generally Itilly-Q2013-08-2928-157/+793
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | did a few things. I wrote many many many new tests, either in old test files or in the three new test files I made. I also did some code-keeping work, deleting trailing whitespace and deleting vestigial code. Lastly, I fixed the parts of the code which I realized were broken thru the process of running tests. =============================================================================== Deleted trailing whitespace: =============================================================================== --\ mediagoblin/decorators.py --\ mediagoblin/auth/tools.py --\ mediagoblin/db/migrations.py --\ mediagoblin/db/models.py --\ mediagoblin/gmg_commands/users.py --\ mediagoblin/moderation/forms.py --\ mediagoblin/moderation/tools.py --\ mediagoblin/moderation/views.py --\ mediagoblin/templates/mediagoblin/moderation/media_panel.html --\ mediagoblin/templates/mediagoblin/moderation/report.html --\ mediagoblin/templates/mediagoblin/moderation/report_panel.html --\ mediagoblin/templates/mediagoblin/moderation/user.html --\ mediagoblin/templates/mediagoblin/moderation/user_panel.html --\ mediagoblin/templates/mediagoblin/user_pages/report.html --\ mediagoblin/templates/mediagoblin/utils/report.html --\ mediagoblin/user_pages/lib.py --\ mediagoblin/user_pages/views.py =============================================================================== Deleted Vestigial Code =============================================================================== --\ mediagoblin/db/util.py --\ mediagoblin/tests/test_notifications.py =============================================================================== Modified the Code: =============================================================================== --\ mediagoblin/moderation/tools.py --| Encapsulated the code around giving/taking away privileges into two | funtions. --\ mediagoblin/moderation/views.py --| Imported and used the give/take away privilege functions --| Replaced 'require_admin_or_moderator_login' with |'user_has_privilege(u"admin")' for adding/taking away privileges, only | admins are allowed to do this. --\ mediagoblin/templates/mediagoblin/banned.html --| Added relevant translation tags --| Added ability to display indefinite banning --\ mediagoblin/templates/mediagoblin/user_pages/media.html --| Made sure the add comments button was only visible for users with the | `commenter` privilege --\ mediagoblin/tests/test_submission.py --| Paroneayea fixed a DetachedInstanceError I was having with the our_user | function --\ mediagoblin/tests/tools.py --| Added a fixture_add_comment_report function for testing. --\ mediagoblin/tools/response.py --| Fixed a minor error where a necessary return statement was missing --| Fit the code within 80 columns --\ mediagoblin/user_pages/views.py --| Added a necessary decorator to ensure that only users with the 'commenter' | privilege can post comments =============================================================================== Wrote new tests for an old test file: =============================================================================== --\ mediagoblin/tests/test_auth.py --| Added a new test to make sure privilege granting on registration happens | correctly --\ mediagoblin/tests/test_modelmethods.py* --| Added a test to ensure the User method has_privilege works properly =============================================================================== Wrote entirely new files full of tests: =============================================================================== --\ mediagoblin/tests/test_moderation.py --\ mediagoblin/tests/test_privileges.py --\ mediagoblin/tests/test_reporting.py =============================================================================== =============================================================================== NOTE: Any files I've marked with a * in this commit report, were actually subm- itted in my last commit. I made that committ to fix an error I was having, so they weren't properly documented in that report. =============================================================================== ===============================================================================
* pushing so paroneayea can help me resolve a conflict within the tests.tilly-Q2013-08-232-18/+16
|
* This commit was just to fix a few of the errors with the merging and totilly-Q2013-08-208-87/+97
| | | | make sure that all of the previous tests work fine.
* Merge branch 'master' into OPW-Moderation-Updatetilly-Q2013-08-2072-174/+2385
|\ | | | | | | | | | | | | | | Conflicts: mediagoblin/db/models.py mediagoblin/decorators.py mediagoblin/routing.py mediagoblin/user_pages/views.py
| * use href='javascript:;' instead of href='#notifications', etcRodney Ewing2013-08-201-3/+3
| |
| * - need self.metadata with BaseProcessingFailRodney Ewing2013-08-192-2/+3
| | | | | | | | - pass feed_url into ProcessMedia run()
| * -update to latest masterRodney Ewing2013-08-194-18/+19
| | | | | | | | | | | | - have mg generate task_id remove
| * Switch deprecated BROKER_HOST to new BROKER_URLSebastian Spaeth2013-08-193-3/+3
| | | | | | | | | | | | | | 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>
| * Tweak Celery TaskSebastian Spaeth2013-08-194-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | - 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>
| * -skip persona test is requests is not installedRodney Ewing2013-08-192-2/+5
| | | | | | | | - should use request.urlgen for location
| * media_confirm_delete: redirect to next, then prev, then user homeAlon Levy2013-08-171-2/+6
| | | | | | | | | | | | | | | | | | 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>
| * load js at the end of the pageRodney Ewing2013-08-164-3/+3
| |
| * use urlgenRodney Ewing2013-08-162-2/+6
| |
| * Merge branch 'auth_docs'Rodney Ewing2013-08-163-0/+99
| |\ | | | | | | | | | | | | Conflicts: docs/source/index.rst
| | * typoRodney Ewing2013-07-091-2/+2
| | |
| | * added docs for the persona pluginRodney Ewing2013-07-091-0/+41
| | |
| | * added basic_auth and openid docs to index and link them togetherRodney Ewing2013-07-092-7/+11
| | |
| | * added openid docsRodney Ewing2013-07-091-0/+32
| | |
| | * basic_auth documentationRodney Ewing2013-07-091-0/+22
| | |
| * | fix persona tests by using a correct queryRodney Ewing2013-08-151-4/+4
| | |
| * | Merge branch 'persona_resquash'Christopher Allan Webber2013-08-1519-10/+904
| |\ \
| | * | Removing the whitespace betwetween action= and its valueChristopher Allan Webber2013-08-151-3/+3
| | | |
| | * | made it so that the create account button works with only persona enabledRodney Ewing2013-07-032-1/+6
| | | |
| | * | moved persona template stuff to use template_hooksRodney Ewing2013-07-0311-35/+86
| | | |
| | * | merge --squash persona branch to take care of a false merge commit inRodney Ewing2013-07-0317-10/+848
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the basic_auth branch that persona is forked from Conflicts: mediagoblin/templates/mediagoblin/auth/login.html mediagoblin/templates/mediagoblin/auth/register.html mediagoblin/templates/mediagoblin/edit/edit_account.html These are commit messages from the squashed persona stuff: - added tests and fixed minor errors - fixed a redirect loop when only persona is enabled and accessing /auth/login - moved persona.js to plugin's static dir - fixes for add/remove persona emails - add and remove personas - working with multiple plugins - working version - switched to hidden form instead of ajax - beginings
| * | Merge remote-tracking branch 'refs/remotes/tsyesika/master'Christopher Allan Webber2013-08-1528-50/+1212
| |\ \ | | | | | | | | | | | | New oauth tools! Heck yeah!
| | * | Fix import errors when running testsJessica Tallon2013-08-131-2/+1
| | | |
| | * | Fix problem causing exception when invalid Authentication header providedxray72242013-07-291-2/+5
| | | |
| | * | Fix problem with routing to oauthxray72242013-07-291-0/+1
| | | |
| | * | Fixes problem with headers pointing to old federation dirxray72242013-07-291-2/+2
| | | |
| | * | Renames OAuth1 code to federationxray72242013-07-229-13/+13
| | | |
| | * | Refactor WTFormDataxray72242013-07-222-10/+26
| | | |
| | * | Fix problem with migration - OAuthJessica Tallon2013-07-223-10/+9
| | | |
| | * | Fixes some typo's and removes unused importsJessica Tallon2013-07-201-6/+5
| | | |
| | * | Moves first versions of the the models to migrationsxray72242013-07-181-7/+72
| | | |
| | * | Adds migration for OAuth1 tablesxray72242013-07-181-1/+15
| | | |
| | * | Adds test for request_tokensxray72242013-07-184-20/+71
| | | |
| | * | Adds some tests for the OAuth and some docsxray72242013-07-162-9/+132
| | | |
| | * | Fixes testsxray72242013-07-148-28/+17
| | | |
| | * | Merge branch 'master' of git://gitorious.org/mediagoblin/mediagoblinxray72242013-07-141-3/+4
| | |\ \
| | * | | Using nonce now, preventing OAuth replay attacksxray72242013-07-143-5/+28
| | | | |
| | * | | Merge branch 'master' of git://gitorious.org/mediagoblin/mediagoblinxray72242013-07-1444-234/+333
| | |\ \ \
| | * | | | Ensures endpoint queries with @oauth_required are validatedxray72242013-07-112-2/+49
| | | | | |
| | * | | | Adds the decoratorxray72242013-07-114-5/+31
| | | | | |
| | * | | | Cleans up some of the OAuth codexray72242013-07-117-60/+134
| | | | | |
| | * | | | Finishes most of oauth, just decorator to completexray72242013-07-114-41/+80
| | | | | |
| | * | | | Adds more support for oauth - access_token & decorators still to doxray72242013-07-117-12/+259
| | | | | |