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
This commit is contained in:
@@ -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('')
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user