mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-20 02:26:12 +00:00
Remove params arg from _process_args
This commit is contained in:
parent
a3c01170be
commit
d1736ec8f3
@ -39,8 +39,8 @@ from indico_chat.xmpp import retrieve_logs
|
||||
class RHChatManageEventLogs(RHEventChatroomMixin, RHChatManageEventBase):
|
||||
"""UI to retrieve logs for a chatroom"""
|
||||
|
||||
def _process_args(self, params):
|
||||
RHChatManageEventBase._process_args(self, params)
|
||||
def _process_args(self):
|
||||
RHChatManageEventBase._process_args(self)
|
||||
RHEventChatroomMixin._process_args(self)
|
||||
|
||||
def _process(self):
|
||||
@ -56,8 +56,8 @@ class RHChatManageEventLogs(RHEventChatroomMixin, RHChatManageEventBase):
|
||||
class RHChatManageEventRetrieveLogsBase(RHEventChatroomMixin, RHChatManageEventBase):
|
||||
"""Retrieves logs for a chatroom"""
|
||||
|
||||
def _process_args(self, params):
|
||||
RHChatManageEventBase._process_args(self, params)
|
||||
def _process_args(self):
|
||||
RHChatManageEventBase._process_args(self)
|
||||
RHEventChatroomMixin._process_args(self)
|
||||
|
||||
if 'get_all_logs' not in request.values:
|
||||
@ -89,8 +89,8 @@ class RHChatManageEventShowLogs(RHChatManageEventRetrieveLogsBase):
|
||||
class RHChatManageEventAttachLogs(RHChatManageEventRetrieveLogsBase):
|
||||
"""Attachs the logs for a chatroom to the event"""
|
||||
|
||||
def _process_args(self, params):
|
||||
RHChatManageEventRetrieveLogsBase._process_args(self, params)
|
||||
def _process_args(self):
|
||||
RHChatManageEventRetrieveLogsBase._process_args(self)
|
||||
self.material_name = request.form['material_name'].strip()
|
||||
self.file_repo_id = None
|
||||
|
||||
|
||||
@ -66,8 +66,8 @@ class RHChatManageEvent(AttachChatroomMixin, RHChatManageEventBase):
|
||||
class RHChatManageEventModify(RHEventChatroomMixin, RHChatManageEventBase):
|
||||
"""Modifies an existing chatroom"""
|
||||
|
||||
def _process_args(self, params):
|
||||
RHChatManageEventBase._process_args(self, params)
|
||||
def _process_args(self):
|
||||
RHChatManageEventBase._process_args(self)
|
||||
RHEventChatroomMixin._process_args(self)
|
||||
|
||||
def _process(self):
|
||||
@ -93,8 +93,8 @@ class RHChatManageEventModify(RHEventChatroomMixin, RHChatManageEventBase):
|
||||
class RHChatManageEventRefresh(RHEventChatroomMixin, RHChatManageEventBase):
|
||||
"""Synchronizes the local chatroom data with the XMPP server"""
|
||||
|
||||
def _process_args(self, params):
|
||||
RHChatManageEventBase._process_args(self, params)
|
||||
def _process_args(self):
|
||||
RHChatManageEventBase._process_args(self)
|
||||
RHEventChatroomMixin._process_args(self)
|
||||
|
||||
def _process(self):
|
||||
@ -146,8 +146,8 @@ class RHChatManageEventCreate(RHChatManageEventBase):
|
||||
class RHChatManageEventAttach(AttachChatroomMixin, RHChatManageEventBase):
|
||||
"""Attaches an existing chatroom to an event"""
|
||||
|
||||
def _process_args(self, params):
|
||||
RHChatManageEventBase._process_args(self, params)
|
||||
def _process_args(self):
|
||||
RHChatManageEventBase._process_args(self)
|
||||
|
||||
def _process(self):
|
||||
form = self._get_attach_form()
|
||||
@ -163,8 +163,8 @@ class RHChatManageEventAttach(AttachChatroomMixin, RHChatManageEventBase):
|
||||
class RHChatManageEventRemove(RHEventChatroomMixin, RHChatManageEventBase):
|
||||
"""Removes a chatroom from an event (and if necessary from the server)"""
|
||||
|
||||
def _process_args(self, params):
|
||||
RHChatManageEventBase._process_args(self, params)
|
||||
def _process_args(self):
|
||||
RHChatManageEventBase._process_args(self)
|
||||
RHEventChatroomMixin._process_args(self)
|
||||
|
||||
def _process(self):
|
||||
|
||||
@ -18,11 +18,9 @@ from __future__ import unicode_literals
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from flask import jsonify, request
|
||||
from flask_pluginengine import current_plugin
|
||||
from pytz import timezone, utc
|
||||
from werkzeug.exceptions import NotFound
|
||||
|
||||
from indico.core.db import db
|
||||
from indico.legacy.webinterface.rh.base import RHProtected
|
||||
@ -72,8 +70,8 @@ class RHEndTimeBase(RHManageTimetableBase):
|
||||
class RHDayEndTime(RHEndTimeBase):
|
||||
"""Get the end_dt of the latest timetable entry or the event start_dt if no entry exist on that date"""
|
||||
|
||||
def _process_args(self, params):
|
||||
RHEndTimeBase._process_args(self, params)
|
||||
def _process_args(self):
|
||||
RHEndTimeBase._process_args(self)
|
||||
self.date = self.event.tzinfo.localize(datetime.strptime(request.args['selectedDay'], '%Y/%m/%d')).date()
|
||||
|
||||
def _process(self):
|
||||
@ -98,12 +96,13 @@ class RHBlockEndTime(RHEndTimeBase):
|
||||
}
|
||||
}
|
||||
|
||||
def _process_args(self, params):
|
||||
RHEndTimeBase._process_args(self, params)
|
||||
self.date = timezone(self.event.timezone).localize(datetime.strptime(request.args['selectedDay'],
|
||||
'%Y/%m/%d'))
|
||||
self.timetable_entry = self.event.timetable_entries.filter_by(
|
||||
type=TimetableEntryType.SESSION_BLOCK, id=request.view_args['entry_id']).first_or_404()
|
||||
def _process_args(self):
|
||||
RHEndTimeBase._process_args(self)
|
||||
self.date = timezone(self.event.timezone).localize(datetime.strptime(request.args['selectedDay'], '%Y/%m/%d'))
|
||||
self.timetable_entry = (self.event.timetable_entries
|
||||
.filter_by(type=TimetableEntryType.SESSION_BLOCK,
|
||||
id=request.view_args['entry_id'])
|
||||
.first_or_404())
|
||||
|
||||
def _process(self):
|
||||
entries = self.timetable_entry.children
|
||||
|
||||
@ -14,9 +14,8 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Indico; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from flask import jsonify
|
||||
from flask import jsonify, request
|
||||
|
||||
from indico.core.config import config
|
||||
from indico.modules.events.management.controllers import RHManageEventBase
|
||||
|
||||
from indico_piwik.reports import (ReportCountries, ReportDevices, ReportDownloads, ReportGeneral, ReportMaterial,
|
||||
@ -25,37 +24,34 @@ from indico_piwik.views import WPStatistics
|
||||
|
||||
|
||||
class RHStatistics(RHManageEventBase):
|
||||
def _process_args(self, params):
|
||||
RHManageEventBase._process_args(self, params)
|
||||
self._params = params
|
||||
self._params['loading_gif'] = '{}/images/loading.gif'.format(config.BASE_URL)
|
||||
self._params['report'] = ReportGeneral.get(event_id=params.get('confId'), contrib_id=params.get('contrib_id'),
|
||||
start_date=params.get('start_date'), end_date=params.get('end_date'))
|
||||
|
||||
def _process(self):
|
||||
return WPStatistics.render_template('statistics.html', self._conf, **self._params)
|
||||
report = ReportGeneral.get(event_id=self.event.id,
|
||||
contrib_id=request.args.get('contrib_id'),
|
||||
start_date=request.args.get('start_date'),
|
||||
end_date=request.args.get('end_date'))
|
||||
return WPStatistics.render_template('statistics.html', self._conf, report=report)
|
||||
|
||||
|
||||
class RHApiBase(RHManageEventBase):
|
||||
ALLOW_LOCKED = True
|
||||
|
||||
def _process_args(self, params):
|
||||
RHManageEventBase._process_args(self, params)
|
||||
self._report_params = {'start_date': params.get('start_date'),
|
||||
'end_date': params.get('end_date')}
|
||||
def _process_args(self):
|
||||
RHManageEventBase._process_args(self)
|
||||
self._report_params = {'start_date': request.args.get('start_date'),
|
||||
'end_date': request.args.get('end_date')}
|
||||
|
||||
|
||||
class RHApiEventBase(RHApiBase):
|
||||
def _process_args(self, params):
|
||||
RHApiBase._process_args(self, params)
|
||||
self._report_params['event_id'] = params['confId']
|
||||
self._report_params['contrib_id'] = params.get('contrib_id')
|
||||
def _process_args(self):
|
||||
RHApiBase._process_args(self)
|
||||
self._report_params['event_id'] = self.event.id
|
||||
self._report_params['contrib_id'] = request.args.get('contrib_id')
|
||||
|
||||
|
||||
class RHApiDownloads(RHApiEventBase):
|
||||
def _process_args(self, params):
|
||||
RHApiEventBase._process_args(self, params)
|
||||
self._report_params['download_url'] = params['download_url']
|
||||
def _process_args(self):
|
||||
RHApiEventBase._process_args(self)
|
||||
self._report_params['download_url'] = request.args['download_url']
|
||||
|
||||
def _process(self):
|
||||
return jsonify(ReportDownloads.get(**self._report_params))
|
||||
|
||||
@ -134,7 +134,7 @@
|
||||
{% trans %}Visitors Geography{% endtrans %}
|
||||
</div>
|
||||
<div class="statsWidgetContent">
|
||||
<img id="graph_countries" src="{{ loading_gif }}"
|
||||
<img id="graph_countries" src="{{ indico_config.IMAGES_BASE_URL }}/loading.gif"
|
||||
alt="{% trans %}Visitor Origins{% endtrans %}">
|
||||
</div>
|
||||
</div>
|
||||
@ -177,7 +177,7 @@
|
||||
{% trans %}User Systems{% endtrans %}
|
||||
</div>
|
||||
<div class="statsWidgetContent" style="text-align:center;">
|
||||
<img id="graph_devices" src="{{ loading_gif }}"
|
||||
<img id="graph_devices" src="{{ indico_config.IMAGES_BASE_URL }}/loading.gif"
|
||||
alt="{% trans %}Visitor Systems{% endtrans %}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -30,12 +30,10 @@ from indico_previewer_jupyter.cpp_highlighter import CppHighlighter
|
||||
|
||||
class RHEventPreviewIPyNB(RH):
|
||||
def _check_access(self):
|
||||
RH._check_access(self)
|
||||
if not self.attachment.can_access(session.user):
|
||||
raise Forbidden
|
||||
|
||||
def _process_args(self, params):
|
||||
RH._process_args(self, params)
|
||||
def _process_args(self):
|
||||
self.attachment = Attachment.find_one(id=request.view_args['attachment_id'], is_deleted=False)
|
||||
|
||||
def _process(self):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user