From 538f6262fd3408568e95746fdfc76c9ae8bc76ef Mon Sep 17 00:00:00 2001 From: Martin Bley Date: Fri, 10 Jun 2016 17:36:02 +0200 Subject: [PATCH] modified for EURO 2016 --- templates/md.html | 27 ++++++++++++++++++++++++++- tipp/views.py | 19 +++++++++++++------ tippy/settings.py | 4 ++-- 3 files changed, 41 insertions(+), 9 deletions(-) diff --git a/templates/md.html b/templates/md.html index e0999a8..df5ce9d 100644 --- a/templates/md.html +++ b/templates/md.html @@ -40,7 +40,32 @@ diff --git a/tipp/views.py b/tipp/views.py index 8551fbd..58e50a8 100644 --- a/tipp/views.py +++ b/tipp/views.py @@ -283,11 +283,18 @@ def matchday(request, ls, season, matchday, template_name='md.html'): for m in mandants: rs = RelUserMandant.objects.filter(mandant=m) for r in rs: - tipp_mates.append({ - 'mate': r.user, - 'tipps': [], - 'sum_score': 0 - }) + """filter duplicates """ + d = False + for item in tipp_mates: + if r.user.first_name == item['mate']: + d = True + + if d is False: + tipp_mates.append({ + 'mate': r.user.first_name, + 'tipps': [], + 'sum_score': 0 + }) matches = [] for match in md_matches: @@ -393,7 +400,7 @@ def matchday(request, ls, season, matchday, template_name='md.html'): posts.append( (post, avatar) ) return render(request, 'md.html', { - #'debug': debug, + 'debug': debug, #'mds_season': mds_in_season, 'cur_md': matchday, 'matches': matches, diff --git a/tippy/settings.py b/tippy/settings.py index 8711aeb..d81afca 100644 --- a/tippy/settings.py +++ b/tippy/settings.py @@ -73,7 +73,7 @@ MEDIA_URL = '/media/' # Don't put anything in this directory yourself; store your static files # in apps' "static/" subdirectories and in STATICFILES_DIRS. # Example: "/home/media/media.lawrence.com/static/" -STATIC_ROOT = '/home/martin/Entwicklung/tippy/TipPy/static/' +STATIC_ROOT = '/home/martin/dev/tippy/TipPy/static/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media/') # URL prefix for static files. @@ -85,7 +85,7 @@ STATICFILES_DIRS = ( # Put strings here, like "/home/html/static" or "C:/www/django/static". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. - '/home/martin/Entwicklung/tippy/TipPy/tippy/static', + '/home/martin/dev/tippy/TipPy/tippy/static', ) # List of finder classes that know how to find static files in