|
5 | 5 |
|
6 | 6 | from django.contrib.auth.decorators import login_required
|
7 | 7 | from django.db.models import Q
|
8 |
| -from django.http import JsonResponse, HttpResponse, Http404, HttpResponseForbidden |
9 |
| -from django.shortcuts import render, get_object_or_404 |
| 8 | +from django.http import HttpResponse, HttpResponseForbidden |
| 9 | +from django.shortcuts import get_object_or_404, render |
10 | 10 | from django.utils import timezone
|
11 | 11 |
|
12 | 12 | from spybot import visualization
|
13 |
| - |
14 |
| -from spybot.forms import TimeRangeForm, AddSteamIDForm |
| 13 | +from spybot.forms import AddSteamIDForm, TimeRangeForm |
| 14 | +from spybot.models import ( |
| 15 | + MergedUser, |
| 16 | + NewsEvent, |
| 17 | + SteamID, |
| 18 | + TSChannel, |
| 19 | + TSUserActivity, |
| 20 | + UserPasskey, |
| 21 | +) |
15 | 22 | from spybot.remote.steam_api import get_steam_user_playing_info
|
16 |
| -from spybot.views.fragments.activity_chart import activity_chart_data |
17 |
| -from spybot.models import TSChannel, TSUserActivity, NewsEvent, MergedUser, UserPasskey, SteamID |
18 | 23 | from spybot.templatetags import ts_filters
|
19 |
| - |
20 |
| -from Spybot2 import settings |
21 |
| -import requests |
22 |
| - |
23 |
| -from spybot.views.common import get_user, get_context |
| 24 | +from spybot.views.common import get_context, get_user |
| 25 | +from spybot.views.fragments.activity_chart import activity_chart_data |
24 | 26 | from spybot.views.fragments.profile_steamids import profile_steamids_data
|
25 | 27 |
|
26 | 28 |
|
@@ -97,22 +99,6 @@ def live(request):
|
97 | 99 | return render(request, 'spybot/live.html', {'clients': clients, 'channels': channels})
|
98 | 100 |
|
99 | 101 |
|
100 |
| -def widget_legacy(request): |
101 |
| - sessions = TSUserActivity.objects.filter(end_time=None) |
102 |
| - |
103 |
| - active_clients = [] |
104 |
| - inactive_clients = [] |
105 |
| - res = {} |
106 |
| - for session in sessions: |
107 |
| - user_name = session.tsuser.name |
108 |
| - channel_name = session.channel.name |
109 |
| - if channel_name == "bei Bedarf anstupsen" or channel_name == "AFK": |
110 |
| - inactive_clients.append(user_name) |
111 |
| - else: |
112 |
| - active_clients.append(user_name) |
113 |
| - res["activeClients"] = active_clients |
114 |
| - res["inactiveClients"] = inactive_clients |
115 |
| - return JsonResponse(res) |
116 | 102 |
|
117 | 103 |
|
118 | 104 | def timeline(request):
|
|
0 commit comments