completely remove usages of django-adminplus
it was futzing up some /admin/ login stuff, and I hadn't actually used the three views using it in years, so probably better to just yeet it (technical term) into the sun. Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
This commit is contained in:
@@ -1,36 +1,13 @@
|
||||
"""Manage ircbot models and admin actions in the admin interface."""
|
||||
|
||||
import logging
|
||||
import xmlrpc.client
|
||||
|
||||
from django.contrib import admin
|
||||
from django.shortcuts import render
|
||||
|
||||
from ircbot.forms import PrivmsgForm
|
||||
from ircbot.models import Alias, BotUser, IrcChannel, IrcPlugin, IrcServer
|
||||
|
||||
log = logging.getLogger('ircbot.admin')
|
||||
|
||||
|
||||
def send_privmsg(request):
|
||||
"""Send a privmsg over XML-RPC to the IRC bot."""
|
||||
if request.method == 'POST':
|
||||
form = PrivmsgForm(request.POST)
|
||||
if form.is_valid():
|
||||
target = form.cleaned_data['target']
|
||||
message = form.cleaned_data['message']
|
||||
|
||||
bot_url = 'http://{0:s}:{1:d}/'.format(form.cleaned_data['xmlrpc_host'],
|
||||
form.cleaned_data['xmlrpc_port'])
|
||||
bot = xmlrpc.client.ServerProxy(bot_url, allow_none=True)
|
||||
bot.reply(None, message, False, target)
|
||||
form = PrivmsgForm()
|
||||
else:
|
||||
form = PrivmsgForm()
|
||||
|
||||
return render(request, 'privmsg.html', {'form': form})
|
||||
|
||||
|
||||
admin.site.register(Alias)
|
||||
admin.site.register(BotUser)
|
||||
admin.site.register(IrcChannel)
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
{% extends 'adminplus/index.html' %}
|
||||
|
||||
{% block title %}Ircbot - Privmsg{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="content-main">
|
||||
<form id="ircbot_privmsg_form" action="{% url 'admin:ircbot_privmsg' %}" method="post">
|
||||
{% csrf_token %}
|
||||
<table>
|
||||
{{ form }}
|
||||
</table>
|
||||
<input class="submit-button" type="submit" value="Privmsg"/>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user