aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/user_pages
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2014-09-16 14:01:43 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2014-09-16 14:01:43 -0500
commitf6bad0eb26fa7e092570afe1fb7f38b3d1a1941d (patch)
tree0ca05e7a95cfb30d8b286f3ec72e8c95e212511b /mediagoblin/user_pages
parent5b64c92e0816e733c2f88b88ddc0aec070cdc0d3 (diff)
parent1b4e199668ada5c2ec47df7432ab69e315dc0601 (diff)
downloadmediagoblin-f6bad0eb26fa7e092570afe1fb7f38b3d1a1941d.tar.lz
mediagoblin-f6bad0eb26fa7e092570afe1fb7f38b3d1a1941d.tar.xz
mediagoblin-f6bad0eb26fa7e092570afe1fb7f38b3d1a1941d.zip
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
Diffstat (limited to 'mediagoblin/user_pages')
-rw-r--r--mediagoblin/user_pages/forms.py6
-rw-r--r--mediagoblin/user_pages/lib.py16
-rw-r--r--mediagoblin/user_pages/routing.py4
3 files changed, 16 insertions, 10 deletions
diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py
index eb786f47..1a09864b 100644
--- a/mediagoblin/user_pages/forms.py
+++ b/mediagoblin/user_pages/forms.py
@@ -21,7 +21,7 @@ from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
class MediaCommentForm(wtforms.Form):
comment_content = wtforms.TextAreaField(
_('Comment'),
- [wtforms.validators.Required()],
+ [wtforms.validators.InputRequired()],
description=_(u'You can use '
u'<a href="http://daringfireball.net/projects/markdown/basics" target="_blank">'
u'Markdown</a> for formatting.'))
@@ -53,11 +53,11 @@ class MediaCollectForm(wtforms.Form):
class CommentReportForm(wtforms.Form):
report_reason = wtforms.TextAreaField(
_('Reason for Reporting'),
- [wtforms.validators.Required()])
+ [wtforms.validators.InputRequired()])
reporter_id = wtforms.HiddenField('')
class MediaReportForm(wtforms.Form):
report_reason = wtforms.TextAreaField(
_('Reason for Reporting'),
- [wtforms.validators.Required()])
+ [wtforms.validators.InputRequired()])
reporter_id = wtforms.HiddenField('')
diff --git a/mediagoblin/user_pages/lib.py b/mediagoblin/user_pages/lib.py
index e5c8defc..5b411a82 100644
--- a/mediagoblin/user_pages/lib.py
+++ b/mediagoblin/user_pages/lib.py
@@ -14,14 +14,14 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from mediagoblin.tools.mail import send_email
-from mediagoblin.tools.template import render_template
-from mediagoblin.tools.translate import pass_to_ugettext as _
from mediagoblin import mg_globals
from mediagoblin.db.base import Session
from mediagoblin.db.models import (CollectionItem, MediaReport, CommentReport,
- MediaComment, MediaEntry)
-from mediagoblin.user_pages import forms as user_forms
+ MediaComment, MediaEntry)
+from mediagoblin.tools.mail import send_email
+from mediagoblin.tools.pluginapi import hook_runall
+from mediagoblin.tools.template import render_template
+from mediagoblin.tools.translate import pass_to_ugettext as _
def send_comment_email(user, comment, media, request):
@@ -73,9 +73,12 @@ def add_media_to_collection(collection, media, note=None, commit=True):
Session.add(collection)
Session.add(media)
+ hook_runall('collection_add_media', collection_item=collection_item)
+
if commit:
Session.commit()
+
def build_report_object(report_form, media_entry=None, comment=None):
"""
This function is used to convert a form object (from a User filing a
@@ -86,7 +89,7 @@ def build_report_object(report_form, media_entry=None, comment=None):
:param media_entry A MediaEntry object. The MediaEntry being repo-
-rted by a MediaReport. In a CommentReport,
this will be None.
- :param comment A MediaComment object. The MediaComment being
+ :param comment A MediaComment object. The MediaComment being
reported by a CommentReport. In a MediaReport
this will be None.
@@ -115,4 +118,3 @@ def build_report_object(report_form, media_entry=None, comment=None):
report_object.report_content = report_form.report_reason.data
report_object.reporter_id = report_form.reporter_id.data
return report_object
-
diff --git a/mediagoblin/user_pages/routing.py b/mediagoblin/user_pages/routing.py
index f0f4d8b7..8eb51c8d 100644
--- a/mediagoblin/user_pages/routing.py
+++ b/mediagoblin/user_pages/routing.py
@@ -101,3 +101,7 @@ add_route('mediagoblin.edit.edit_media',
add_route('mediagoblin.edit.attachments',
'/u/<string:user>/m/<int:media_id>/attachments/',
'mediagoblin.edit.views:edit_attachments')
+
+add_route('mediagoblin.edit.metadata',
+ '/u/<string:user>/m/<int:media_id>/metadata/',
+ 'mediagoblin.edit.views:edit_metadata')