Skip to content

Commit

Permalink
Merge branch 'master' of github.com:merforga/gw2raidar
Browse files Browse the repository at this point in the history
  • Loading branch information
amadanmath committed Oct 24, 2017
2 parents 67b4855 + e39e976 commit cd4a219
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
7 changes: 7 additions & 0 deletions gw2raidar/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
# (it can be set in `settings_local.py`)
ALLOWED_HOSTS = []

INTERNAL_IPS = ['127.0.0.1']


# Application definition

Expand Down Expand Up @@ -160,3 +162,8 @@
from .settings_local import *
except ImportError:
pass

if DEBUG:
if importlib.util.find_spec("debug_toolbar"):
INSTALLED_APPS.append('debug_toolbar')
MIDDLEWARE.append('debug_toolbar.middleware.DebugToolbarMiddleware')
1 change: 1 addition & 0 deletions raidar/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def url_id_link(self, obj):

search_fields = ('=url_id', '=filename', '^area__name', '=characters__name', '^characters__account__name', '=characters__account__user__username', '=tags__name', '=category__name')
list_display = ('filename', 'url_id_link', 'area', 'success', 'category', 'started_at', 'duration', 'uploaded_at', 'uploaded_by')
list_select_related = ('category', 'uploaded_by', 'area')
inlines = (ParticipationInline,)
readonly_fields = ('url_id', 'started_at', 'duration', 'uploaded_at', 'uploaded_by', 'area', 'filename')

Expand Down
9 changes: 8 additions & 1 deletion raidar/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.conf import settings
from django.conf.urls import url
from django.conf.urls import url, include
from django.contrib.auth import views as auth_views
import importlib

from . import views

Expand Down Expand Up @@ -30,3 +31,9 @@
url(r'^$', views.index, name = "index"),
url(r'^global_stats(?:/(?P<era_id>[0-9]+))?(?:/area-(?P<area_id>[0-9]+))?(?P<json>\.json)?$', views.global_stats, name = "global_stats"),
]

if settings.DEBUG and importlib.util.find_spec('debug_toolbar'):
import debug_toolbar
urlpatterns = [
url(r'^__debug__/', include(debug_toolbar.urls)),
] + urlpatterns
2 changes: 1 addition & 1 deletion raidar/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ def profile_graph(request):
stat = request.POST['stat']

participations = Participation.objects.select_related('encounter').filter(
encounter__era_id=era_id, character__account__user=request.user)
encounter__era_id=era_id, character__account__user=request.user, encounter__success=True)

try:
if area_id.startswith('All'):
Expand Down

0 comments on commit cd4a219

Please sign in to comment.