178 Commits

Author SHA1 Message Date
Jessica Tallon
c5f258fec0 Fix #1007 - get location object not string of location name; caused 500 when editing profile 2014-10-27 11:11:43 +00:00
Jessica Tallon
ed48454558 Merge branch 'location'
Add Location model which holds textual, geolocation coordiantes
	or postal addresses. This migrates data off Image model metadata
	onto the general Location model. It also adds the ability for location
	to be set on MediaEntry, User, MediaComment and Collection models.

	The geolocation plugin has been updated so that the location can be displayed
	in more general places rather than explicitely on the MediaEntry view.
	If GPS coordiantes are set for the User the profile page will also have the
	OSM provided by the geolocation plugin.
2014-10-09 19:20:13 +01:00
Jessica Tallon
c0434db469 Add location model and migrations 2014-10-09 19:16:54 +01:00
Jessica Tallon
7e15632b5a Fix #549 - Deauthorize OAuth applications 2014-10-01 19:45:53 +01:00
Christopher Allan Webber
13f37e75eb Fix iteritems usage on python 3
This commit sponsored by Ben (Free Software Melbourne) Finney.  Thanks!
2014-09-16 15:07:33 -05:00
Christopher Allan Webber
f6bad0eb26 Merge branch 'master' into merge-python3-port
Has some issues, will iteratively fix!

Conflicts:
	mediagoblin/gmg_commands/__init__.py
	mediagoblin/gmg_commands/deletemedia.py
	mediagoblin/gmg_commands/users.py
	mediagoblin/oauth/views.py
	mediagoblin/plugins/api/views.py
	mediagoblin/tests/test_api.py
	mediagoblin/tests/test_edit.py
	mediagoblin/tests/test_oauth1.py
	mediagoblin/tests/test_util.py
	mediagoblin/tools/mail.py
	mediagoblin/webfinger/views.py
	setup.py
2014-09-16 14:01:43 -05:00
Loïc Le Ninan
0742e11dff Fixes #899 : DeprecationWarning about Required going away in WTForms 3.0. Replaced Required with InputRequired. 2014-06-13 10:23:07 -05:00
Berker Peksag
e49b7e02b2 Use six.text_type instead of unicode().
I will be switch to use ``from __future__ import unicode_literals`` later.
2014-06-02 20:59:28 +03:00
tilly-Q
1688abbfc4 Cleaned up the code a little bit 2014-05-14 12:03:58 -04:00
tilly-Q
0d6550fb05 Tweaked the metadata edit screen to run jsonschema validators against the data. 2014-05-14 11:51:13 -04:00
tilly-Q
6b6b1b076b Made some changes so that the metadata editing page works well with the updated
metadata tools.
2014-05-12 13:13:46 -04:00
tilly-Q
494bce47f9 Changed the format of the wtforms table slightly 2014-05-12 12:20:03 -04:00
tilly-Q
d015e4a84d Added in a few blank lines when a user edits the metadata of a file that has
none.
2014-05-06 17:45:43 -04:00
tilly-Q
9919fb08a4 Made it so the metadata editting page is only one step away from functioning
correctly.
2014-05-06 17:19:30 -04:00
tilly-Q
e80596c80e Created a UI for editting a media's metadata. Had to add a new macro to
wtforms.html in the process.
2014-05-06 17:00:25 -04:00
tilly-Q
f0cfd3396e Set up the metadata editor forms 2014-05-06 12:54:08 -04:00
tilly-Q
fffc5dcfe0 Created the media metadata editor page 2014-05-06 12:39:23 -04:00
Christopher Allan Webber
56c4ad89eb Merge remote-tracking branch 'refs/remotes/tilly-q/OPW-Moderation-Update'
Conflicts:
	mediagoblin/templates/mediagoblin/user_pages/user.html
	mediagoblin/tests/test_auth.py
	mediagoblin/tests/test_submission.py
2013-10-07 15:48:33 -05:00
Christopher Allan Webber
515e3bd9af Fixing ALL THE BROKEN TESTS. I probably broke most of them.
- We've now broken out user.html and user_nonactive.html but the
   tests didn't reflect it
 - the location of one of the module imports broke, but I didn't
   notice because of .pyc files ;)

This commit sponsored by Tiberiu C. Turbureanu (ceata.org).
Thank you!
2013-09-29 10:41:43 -05:00
Christopher Allan Webber
201ac38895 Fixing import error after merge of basic_auth branch.
This commit sponsored by geoffrey jost.  Thank you!
2013-09-19 18:02:43 -05:00
Christopher Allan Webber
74ae6fb0b6 Merge remote-tracking branch 'refs/remotes/rodney757/auth_refactor'
Conflicts:
	mediagoblin/auth/views.py
	mediagoblin/edit/forms.py
	mediagoblin/templates/mediagoblin/edit/edit_account.html
2013-09-19 16:04:23 -05:00
tilly-Q
045fe0ee9d Merge branch 'master' into OPW-Moderation-Update
Conflicts:
	mediagoblin/db/migrations.py
2013-09-12 18:58:04 -04:00
Sebastian Spaeth
560fd63843 Improve checkbox description
Do not Enable/Disable next to a checkbox. So what does an enabled checkbox do then?
2013-09-04 14:54:00 +02:00
Rodney Ewing
dd57c6c5e5 didn't remove form.new_email when change email was moved to its own view 2013-08-31 13:45:58 -07:00
Christopher Allan Webber
6c3d383bbb Merge remote-tracking branch 'refs/remotes/rodney757/email' 2013-08-25 13:23:27 -05:00
Rodney Ewing
5a6e4e1307 check for form.password in the off chance that a user is logged in and the server switches the authentication method from basic_auth to openid. 2013-08-20 08:25:45 -07:00
Rodney Ewing
402f436011 maybe have change password and email on same page 2013-08-20 08:25:45 -07:00
Rodney Ewing
93d805ad6b add user prefrence for insite notifications 2013-08-20 08:10:50 -07:00
Rodney Ewing
af665c4eb9 moved change_pass to basic_auth and fixed some typos with the moving of forgot pass 2013-08-16 10:28:48 -07:00
tilly-Q
8394febbe1 This has been an update to clean out the code a little bit. The primary change
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
2013-08-13 18:38:00 -04:00
Rodney Ewing
f7998c3326 fix for boolean fields 2013-07-11 16:29:16 -07:00
Rodney Ewing
44082b12d8 Patch by Strum. Ticket #451 - Convert all mongokit style .find, .find_one, .one calls over to SQLAlchemy queries 2013-07-11 14:17:50 -07:00
Rodney Ewing
5adb906a0a merge --squash openid branch to take care of a false merge commit in the
basic_auth branch that openid is forked from

Commits squashed together (in reverse chronological order):
 - do the label thing only for boolean fields
 - made edit_account to autofocus on the first field
 - added feature to render_divs where if field.label == '' then it
   will render form.description the same a render_label
 - added allow_registration check
 - refactored create_user
 - removed verification_key from create_user
 - removed get_user from openid
 - cleanup after removing openid from template_env.globals
 - fix for werkzueg 0.9.1
 - cleanup after merge
 - more tests
 - restored openid extra_validation just for safety
 - tests for openid
 - deleted openid extra_validation
 - passed next parameter in session for openid
 - fixed a bug that was deleting the messages
 - implemented openid store using sqlalchemy
 - ask openid provider for 'nickname' to prefill username in registration form
 - refactored delete openid url to work with generic urls such as
   google and to not allow a user to delete a url if it is there only
   one and they don't have a pw
 - refactored login to register user workflow, which fixed a problem
   where the 'or register with a password link' wasn't showing up when
   the finish_login view called the register view because there wasn't
   any redirect.
 - added the ability to remove openid's
 - added the ability to add openids to an existing account
 - refactored start_login and finish_login views
 - modified edit_account.html to use render_divs
 - modified gmg/edit/views to behave appropriatly if no password
   authentication is enabled. moved the update email stuff to it's own
   funtion to make edit_account view cleaner. edit_account now
   modifies the form depending on the plugins.
 - minor typos
 - added retrieving email from openid provider
 - moved allow_registration check to a decorator
 - moved check if auth is enabled to a decorator
 - changed openid user registration to go through login first
 - cleanup after merge
 - modified verification emails to use itsdangerous tokens
 - added error handling on bad token, fixed route, and added tests
 - added support for user to change email address
 - added link to login view openid/password in login template
 - updated openid get_user function
 - modified get_user function to take kwargs instead of username
 - no need for user might be email kwarg in check_login_simple
 - added gen_password_hash and check_password functions to auth/__init__
 - added focus to form input
 - made imports fully qualified
 - modified basic_auth.check_login to check that the user has a pw_hash first
 - changed occurances of form.data['whatever'] to form.whatever.data
 - convert tabs to spaces in register template, remove unsed
   templates, and fixed trans tags in templates
 - in process of openid login. it works, but needs major imporvements
 - make password field required in basic_auth form
 - check if password field present in basic_auth create_user
 - modified openid create_user function
 - modified models based on Elronds suggestions
 - changed register form action to a variable to be passed in by the
   view using the template
 - openid plugin v0, still need to authenticate via openid.
 - added a register_user function to be able to use in a plugin's
   register view, and modified auth/views.register to redirect to
   openid/register if appropriate.
 - Modified basic_auth plugin to work with modified auth plugin
   hooks. Added context variables. Removed basic_auth/tools which was
   previously renamed to basic_auth/lib.
 - modified auth/__init__ hooks to work better with multiple
   plugins. Removed auth/lib.py. And added a basic_extra_verification
   function that all plugins will use.
 - added models and migrations for openid plugin
2013-07-03 13:49:16 -05:00
Rodney Ewing
1e21471a8a added feature to render_divs where if field.label == '' then it will render form.description the same a render_label 2013-06-25 16:28:45 -07:00
Rodney Ewing
6174169786 cleanup after merge 2013-06-25 13:43:33 -07:00
Rodney Ewing
af4414a85f Merge remote-tracking branch 'upstream/master' into auth
Conflicts:
	mediagoblin/app.py
	mediagoblin/auth/forms.py
	mediagoblin/auth/tools.py
	mediagoblin/db/migrations.py
	mediagoblin/db/models.py
	mediagoblin/edit/views.py
	mediagoblin/plugins/basic_auth/tools.py
	mediagoblin/tests/test_edit.py
2013-06-25 13:37:21 -07:00
Christopher Allan Webber
f7698af1c1 Removing the "enter your password to change your email" bit.
A good idea, though it feels fairly clumsy in the form, and I think if
you're logged in you can already sabotage the user pretty well.

This commit sponsored by Sergey Matveev.  Thanks!
2013-06-21 17:24:33 -05:00
Rodney Ewing
a90b350f71 send_verification_email was moved to auth/tools 2013-05-29 13:19:36 -07:00
Rodney Ewing
f670f48ddd form is already validated, no need to validate again 2013-05-29 13:13:50 -07:00
Rodney Ewing
377db0e7ff added error handling on bad token, fixed route, and added tests 2013-05-24 18:16:12 -07:00
Rodney Ewing
89e1563f68 added support for user to change email address 2013-05-24 18:16:12 -07:00
Rodney Ewing
9008e09941 fixed failing tests after rebase 2013-05-24 16:52:50 -07:00
Rodney Ewing
9c2c9be79d moved bcrypt_gen_password_hash to basic_auth/tools and added gen_password_hash function to auth/__init__ 2013-05-24 16:52:48 -07:00
Rodney Ewing
d54cf48a33 moved bcrypt_check_password to basic_auth/tools from auth/lib 2013-05-24 16:52:48 -07:00
Rodney Ewing
2ba7603469 fixed translation, and changed tabs to spaces, and change it so the user can view their password as they're typing. 2013-05-21 08:51:21 -07:00
Rodney Ewing
39aa1db4d6 moved change pass to a seperate view and fixed issues 709 2013-05-20 14:28:43 -07:00
Elrond
2e6ee596ad Create redir_obj and use it around.
This is a shortcut function to redirect to the main page
for an object. Objects currently supported: media entries
and collections.

And go around and replace various places to use this.
2013-04-28 23:09:20 +02:00
Elrond
5ae0cbaa55 No lazy_* needed here; Add ReallyLazyProxy.__repr__.
One should use lazy_* only if you have a good reason.

This one found by our unit tests!

For example add_message adds the message to the session,
the session needs to be serialized (with json) and well,
LazyProxy is not serializable.

To aid in debugging, gave our ReallyLazyProxy a __repr__.
2013-04-25 14:31:29 +02:00
Aditi Mittal
665b9c420a Fix-bug-667-Use-lazy_pass_to_ugettext-for-forms. 2013-04-24 16:40:29 -05:00
Elrond
455fd36ff6 Use GenerateSlugMixin for collections.
Use the new way of generating slugs also for collections.
Also drop the dummy_db arg to check_collection_slug_used.
2013-04-06 16:53:04 +02:00