From afbafbb4b9e18f566b1a83e99fd8d53003883a90 Mon Sep 17 00:00:00 2001 From: Paul Upendo Date: Fri, 28 Apr 2017 13:39:06 +0300 Subject: [PATCH 01/18] Remove settings from gitignore --- .gitignore | 2 +- wger/settings.py | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 wger/settings.py diff --git a/.gitignore b/.gitignore index 080429a..cced009 100644 --- a/.gitignore +++ b/.gitignore @@ -46,7 +46,7 @@ coverage.xml # Django stuff: *.log -settings*.py +# settings*.py *.sqlite /CACHE diff --git a/wger/settings.py b/wger/settings.py new file mode 100644 index 0000000..260c564 --- /dev/null +++ b/wger/settings.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from wger.settings_global import * + +# Use 'DEBUG = True' to get more details for server errors +DEBUG = True +TEMPLATES[0]['OPTIONS']['debug'] = True + +ADMINS = ( + ('Your name', 'your_email@example.com'), +) +MANAGERS = ADMINS + + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'test_wger', + 'USER': 'postgres', + 'PASSWORD': '', + 'HOST': '127.0.0.1', + 'PORT': '', + } +} + +# Make this unique, and don't share it with anybody. +SECRET_KEY = '2#pl526=dhawlfh=7d_^69ow@ry)b*j4l=oe!u^o_8*mpfi^n-' + +# Your reCaptcha keys +RECAPTCHA_PUBLIC_KEY = '' +RECAPTCHA_PRIVATE_KEY = '' +NOCAPTCHA = True + +# The site's URL (e.g. http://www.my-local-gym.com or http://localhost:8000) +# This is needed for uploaded files and images (exercise images, etc.) to be +# properly served. +SITE_URL = 'http://localhost:8000' + +# Path to uploaded files +# Absolute filesystem path to the directory that will hold user-uploaded files. +MEDIA_ROOT = '/Users/Upendo/.local/share/wger/media' +MEDIA_URL = '/media/' + +# Allow all hosts to access the application. Change if used in production. +ALLOWED_HOSTS = '*' + +# This might be a good idea if you setup memcached +#SESSION_ENGINE = "django.contrib.sessions.backends.cache" + +# Configure a real backend in production +if DEBUG: + EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' + +# Sender address used for sent emails +WGER_SETTINGS['EMAIL_FROM'] = 'wger Workout Manager ' + +# Your twitter handle, if you have one for this instance. +#WGER_SETTINGS['TWITTER'] = '' From 8fdaba0e8fb04d20bff9e00a8c9cfd9f39e10974 Mon Sep 17 00:00:00 2001 From: Paul Upendo Date: Fri, 28 Apr 2017 13:43:06 +0300 Subject: [PATCH 02/18] Added global setting file --- wger/settings_global.py | 372 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 372 insertions(+) create mode 100644 wger/settings_global.py diff --git a/wger/settings_global.py b/wger/settings_global.py new file mode 100644 index 0000000..abba0a8 --- /dev/null +++ b/wger/settings_global.py @@ -0,0 +1,372 @@ +# -*- coding: utf-8 -*- + +# This file is part of wger Workout Manager. +# +# wger Workout Manager is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# wger Workout Manager is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License + +import re +import sys + +''' +This file contains the global settings that don't usually need to be changed. +For a full list of options, visit: + https://docs.djangoproject.com/en/dev/ref/settings/ +''' + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +import os +BASE_DIR = os.path.abspath(os.path.dirname(__file__)) +SITE_ROOT = os.path.realpath(os.path.dirname(__file__)) + +# +# Application definition +# +SITE_ID = 1 +ROOT_URLCONF = 'wger.urls' +WSGI_APPLICATION = 'wger.wsgi.application' + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.messages', + 'django.contrib.staticfiles', + + # Uncomment the next line to enable the admin: + 'django.contrib.admin', + + # Apps from wger proper + 'wger.core', + 'wger.manager', + 'wger.weight', + 'wger.exercises', + 'wger.nutrition', + 'wger.software', + 'wger.utils', + 'wger.config', + 'wger.gym', + 'wger.email', + + # reCaptcha support, see https://github.com/praekelt/django-recaptcha + 'captcha', + + # The sitemaps app + 'django.contrib.sitemaps', + + # Django mobile + 'django_mobile', + + # thumbnails + 'easy_thumbnails', + + # CSS/JS compressor + 'compressor', + + # REST-API + 'tastypie', + 'rest_framework', + 'rest_framework.authtoken', + + # Breadcrumbs + 'django_bootstrap_breadcrumbs', + + # CORS + 'corsheaders', + + # django-bower for installing bower packages + 'djangobower', +) + +# added list of external libraries to be installed by bower +BOWER_INSTALLED_APPS = ( + 'jquery#2.1.x', + 'bootstrap', + 'd3', + 'shariff', + 'tinymce-dist', + 'DataTables', + 'components-font-awesome', + 'tinymce', + 'metrics-graphics', + 'devbridge-autocomplete#1.2.x', + 'sortablejs#1.4.x', +) + + +MIDDLEWARE_CLASSES = ( + 'corsheaders.middleware.CorsMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + + # Javascript Header. Sends helper headers for AJAX + 'wger.utils.middleware.JavascriptAJAXRedirectionMiddleware', + + # Custom authentication middleware. Creates users on-the-fly for certain paths + 'wger.utils.middleware.WgerAuthenticationMiddleware', + + # Send an appropriate Header so search engines don't index pages + 'wger.utils.middleware.RobotsExclusionMiddleware', + + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'django.middleware.locale.LocaleMiddleware', + + # Django mobile + 'django_mobile.middleware.MobileDetectionMiddleware', + 'django_mobile.middleware.SetFlavourMiddleware', +) + +AUTHENTICATION_BACKENDS = ( + 'django.contrib.auth.backends.ModelBackend', + 'wger.utils.helpers.EmailAuthBackend' +) + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + # 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'wger.utils.context_processor.processor', + + # Django + 'django.contrib.auth.context_processors.auth', + 'django.template.context_processors.debug', + 'django.template.context_processors.i18n', + 'django.template.context_processors.media', + 'django.template.context_processors.static', + 'django.template.context_processors.tz', + 'django.contrib.messages.context_processors.messages', + + # Django mobile + 'django_mobile.context_processors.flavour', + + # Breadcrumbs + 'django.template.context_processors.request' + ], + 'loaders': [ + # Django mobile + 'django_mobile.loader.Loader', + + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', + ], + 'debug': False + }, + }, +] + +# Store the user messages in the session +MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage' + +STATICFILES_FINDERS = ( + 'django.contrib.staticfiles.finders.FileSystemFinder', + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', + # added BowerFinder to list of static file finders + 'djangobower.finders.BowerFinder', + + # Django compressor + 'compressor.finders.CompressorFinder', +) + + +# +# Email +# +EMAIL_SUBJECT_PREFIX = '[wger] ' +# EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' + + +# +# Login +# +LOGIN_URL = '/user/login' +LOGIN_REDIRECT_URL = '/' + + +# +# Internationalization +# +USE_TZ = True +USE_I18N = True +USE_L10N = True + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# On Unix systems, a value of None will cause Django to use the same +# timezone as the operating system. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = None + +# Restrict the available languages +LANGUAGES = ( + ('en', 'English'), + ('de', 'German'), + ('bg', 'Bulgarian'), + ('es', 'Spanish'), + ('ru', 'Russian'), + ('nl', 'Dutch'), + ('pt', 'Portuguese'), + ('el', 'Greek'), + ('cs', 'Czech'), + ('sv', 'Swedish'), + ('no', 'Norwegian'), +) + +# Default language code for this installation. +LANGUAGE_CODE = 'en' + +# All translation files are in one place +LOCALE_PATHS = ( + os.path.join(SITE_ROOT, 'locale'), +) + +FLAVOURS_STORAGE_BACKEND = 'session' + + +# +# Logging +# See http://docs.python.org/library/logging.config.html +# +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'formatters': { + 'simple': { + 'format': '%(levelname)s %(asctime)s %(module)s %(message)s' + }, + }, + 'handlers': { + 'console': { + 'level': 'DEBUG', + 'class': 'logging.StreamHandler', + 'formatter': 'simple' + }, + }, + 'loggers': { + 'wger': { + 'handlers': ['console'], + 'level': 'DEBUG', + } + } +} + + +# +# ReCaptcha +# +RECAPTCHA_USE_SSL = True + + +# +# Cache +# +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', + 'LOCATION': 'wger-cache', + 'TIMEOUT': 30 * 24 * 60 * 60, # Cache for a month + } +} + + +# +# Easy thumbnails +# +THUMBNAIL_ALIASES = { + '': { + 'micro': {'size': (30, 30)}, + 'micro_cropped': {'size': (30, 30), 'crop': 'smart'}, + + 'thumbnail': {'size': (80, 80)}, + 'thumbnail_cropped': {'size': (80, 80), 'crop': 'smart'}, + + 'small': {'size': (200, 200)}, + 'small_cropped': {'size': (200, 200), 'crop': 'smart'}, + + 'medium': {'size': (400, 400)}, + 'medium_cropped': {'size': (400, 400), 'crop': 'smart'}, + + 'large': {'size': (800, 800), 'quality': 90}, + 'large_cropped': {'size': (800, 800), 'crop': 'smart', 'quality': 90}, + }, +} + + +# +# Django compressor +# +STATIC_ROOT = '' +STATIC_URL = '/static/' + +# The default is not DEBUG, override if needed +# COMPRESS_ENABLED = True +COMPRESS_CSS_FILTERS = ( + 'compressor.filters.css_default.CssAbsoluteFilter', + 'compressor.filters.cssmin.rCSSMinFilter' +) +COMPRESS_ROOT = STATIC_ROOT + +# BOWER binary +if sys.platform.startswith('win32'): + BOWER_PATH = os.path.join('node_modules', '.bin', 'bower.cmd') +else: + BOWER_PATH = os.path.join('node_modules', '.bin', 'bower') + +# +# Django Rest Framework +# +REST_FRAMEWORK = { + 'DEFAULT_PERMISSION_CLASSES': ('wger.utils.permissions.WgerPermission',), + 'PAGINATE_BY': 20, + 'PAGINATE_BY_PARAM': 'limit', # Allow client to override, using `?limit=xxx`. + 'TEST_REQUEST_DEFAULT_FORMAT': 'json', + 'DEFAULT_AUTHENTICATION_CLASSES': ( + 'rest_framework.authentication.SessionAuthentication', + 'rest_framework.authentication.TokenAuthentication', + ), + 'DEFAULT_FILTER_BACKENDS': ('rest_framework.filters.DjangoFilterBackend', + 'rest_framework.filters.OrderingFilter',) +} + + +# +# CORS headers: allow all hosts to access the API +# +CORS_ORIGIN_ALLOW_ALL = True +CORS_URLS_REGEX = r'^/api/.*$' + +# +# Ignore these URLs if they cause 404 +# +IGNORABLE_404_URLS = ( + re.compile(r'^/favicon\.ico$'), +) + +# +# Application specific configuration options +# +# Consult docs/settings.rst for more information +# +WGER_SETTINGS = { + 'USE_RECAPTCHA': False, + 'REMOVE_WHITESPACE': False, + 'ALLOW_REGISTRATION': True, + 'ALLOW_GUEST_USERS': True, + 'EMAIL_FROM': 'wger Workout Manager ', + 'TWITTER': False +} From b54bfdf2e27a8c904e293d9a00018996651c1f25 Mon Sep 17 00:00:00 2001 From: Paul Upendo Date: Fri, 28 Apr 2017 13:45:55 +0300 Subject: [PATCH 03/18] Write runserver script for heroku --- Procfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Procfile b/Procfile index 968de97..8f351ba 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: gunicorn wger.wsgi --log-file - \ No newline at end of file +web: python manage.py runserver 0.0.0.0:$PORT \ No newline at end of file From d6b001c19411693295e05b6decf48f6ff2527920 Mon Sep 17 00:00:00 2001 From: Paul Upendo Date: Fri, 28 Apr 2017 13:51:42 +0300 Subject: [PATCH 04/18] Revert db to sqllite --- wger/settings.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/wger/settings.py b/wger/settings.py index 260c564..93ccaa9 100644 --- a/wger/settings.py +++ b/wger/settings.py @@ -6,26 +6,26 @@ # Use 'DEBUG = True' to get more details for server errors DEBUG = True TEMPLATES[0]['OPTIONS']['debug'] = True - +STATIC_ROOT = os.path.join(SITE_ROOT, 'staticfiles') ADMINS = ( - ('Your name', 'your_email@example.com'), -) + ('Your name', 'your_email@example.com'), + ) MANAGERS = ADMINS DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'test_wger', - 'USER': 'postgres', + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': 'database.sqlite', + 'USER': '', 'PASSWORD': '', 'HOST': '127.0.0.1', 'PORT': '', - } +} } # Make this unique, and don't share it with anybody. -SECRET_KEY = '2#pl526=dhawlfh=7d_^69ow@ry)b*j4l=oe!u^o_8*mpfi^n-' +SECRET_KEY = 'e_e^a#btn1a76r@y9@76pplm)kk8f&5zgtjkv22i-5*#_3^z0-' # Your reCaptcha keys RECAPTCHA_PUBLIC_KEY = '' @@ -39,7 +39,7 @@ # Path to uploaded files # Absolute filesystem path to the directory that will hold user-uploaded files. -MEDIA_ROOT = '/Users/Upendo/.local/share/wger/media' +MEDIA_ROOT = '/Users/kjoenzau/.local/share/wger/media' MEDIA_URL = '/media/' # Allow all hosts to access the application. Change if used in production. From f77c44d545f0741475d741b0a571dd5b343dcc75 Mon Sep 17 00:00:00 2001 From: Paul Upendo Date: Fri, 28 Apr 2017 14:02:53 +0300 Subject: [PATCH 05/18] Change invoke to dbsqlite --- wger/settings.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/wger/settings.py b/wger/settings.py index 93ccaa9..ea0d3e9 100644 --- a/wger/settings.py +++ b/wger/settings.py @@ -6,26 +6,26 @@ # Use 'DEBUG = True' to get more details for server errors DEBUG = True TEMPLATES[0]['OPTIONS']['debug'] = True -STATIC_ROOT = os.path.join(SITE_ROOT, 'staticfiles') + ADMINS = ( - ('Your name', 'your_email@example.com'), - ) + ('Your name', 'your_email@example.com'), +) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': 'database.sqlite', + 'NAME': '/Users/Upendo/wger-bau-meister/wger/database.sqlite', 'USER': '', 'PASSWORD': '', - 'HOST': '127.0.0.1', + 'HOST': '', 'PORT': '', -} + } } # Make this unique, and don't share it with anybody. -SECRET_KEY = 'e_e^a#btn1a76r@y9@76pplm)kk8f&5zgtjkv22i-5*#_3^z0-' +SECRET_KEY = 'zod&tonn+t$_02s#f6*d5vo19i@z%@v&=6(4ajght+-&v&5_r$' # Your reCaptcha keys RECAPTCHA_PUBLIC_KEY = '' @@ -39,7 +39,7 @@ # Path to uploaded files # Absolute filesystem path to the directory that will hold user-uploaded files. -MEDIA_ROOT = '/Users/kjoenzau/.local/share/wger/media' +MEDIA_ROOT = '/Users/Upendo/.local/share/wger/media' MEDIA_URL = '/media/' # Allow all hosts to access the application. Change if used in production. From b032bb39e7c5a0cfa75a0223140ea2ae658f28e0 Mon Sep 17 00:00:00 2001 From: Paul Upendo Date: Fri, 28 Apr 2017 14:14:08 +0300 Subject: [PATCH 06/18] Change invoke to dbsqlite --- wger/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wger/settings.py b/wger/settings.py index ea0d3e9..d07b73b 100644 --- a/wger/settings.py +++ b/wger/settings.py @@ -25,7 +25,7 @@ } # Make this unique, and don't share it with anybody. -SECRET_KEY = 'zod&tonn+t$_02s#f6*d5vo19i@z%@v&=6(4ajght+-&v&5_r$' +SECRET_KEY = '^==kfubx+&ny@ee^(m^o7mcppw)8_3^5&n!0-+@#e2ophlh*1u' # Your reCaptcha keys RECAPTCHA_PUBLIC_KEY = '' From 2bb79b7c0c11a4f2d20e4e647685a282ccc8070c Mon Sep 17 00:00:00 2001 From: Paul Upendo Date: Tue, 2 May 2017 09:26:45 +0300 Subject: [PATCH 07/18] Add files to .gitignore. Migrations --- .DS_Store | Bin 6148 -> 6148 bytes .gitignore | 4 +- .../migrations/0002_auto_20170428_2135.py | 20 ++++++++ .../migrations/0010_auto_20170428_2135.py | 20 ++++++++ .../migrations/0002_auto_20170428_2135.py | 25 ++++++++++ .../migrations/0004_auto_20170428_2135.py | 45 ++++++++++++++++++ .../gym/migrations/0007_auto_20170428_2135.py | 34 +++++++++++++ .../migrations/0008_auto_20170428_2135.py | 21 ++++++++ .../migrations/0002_auto_20170428_2135.py | 30 ++++++++++++ wger/settings.py | 10 ++-- 10 files changed, 202 insertions(+), 7 deletions(-) create mode 100644 wger/config/migrations/0002_auto_20170428_2135.py create mode 100644 wger/core/migrations/0010_auto_20170428_2135.py create mode 100644 wger/email/migrations/0002_auto_20170428_2135.py create mode 100644 wger/exercises/migrations/0004_auto_20170428_2135.py create mode 100644 wger/gym/migrations/0007_auto_20170428_2135.py create mode 100644 wger/manager/migrations/0008_auto_20170428_2135.py create mode 100644 wger/nutrition/migrations/0002_auto_20170428_2135.py diff --git a/.DS_Store b/.DS_Store index 273f9ddfc4b5106225db9554a2a485a8aeb10db0..1363fbc9b4fd36282e9c8096a9095db3a19d480f 100644 GIT binary patch delta 17 YcmZoMXfc@Jz{oh!QJ#@;W8z|Q04?7H`Tzg` delta 24 gcmZoMXfc@Jz{oJsQGR3MGWN;(BCMOaIezj30ARHTlK=n! diff --git a/.gitignore b/.gitignore index cced009..3ffb631 100644 --- a/.gitignore +++ b/.gitignore @@ -43,10 +43,10 @@ coverage.xml # Translations *.mo *.pot - +.DS_Store # Django stuff: *.log -# settings*.py +settings.py *.sqlite /CACHE diff --git a/wger/config/migrations/0002_auto_20170428_2135.py b/wger/config/migrations/0002_auto_20170428_2135.py new file mode 100644 index 0000000..bb3ec28 --- /dev/null +++ b/wger/config/migrations/0002_auto_20170428_2135.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.13 on 2017-04-28 18:35 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('config', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='languageconfig', + name='item', + field=models.CharField(choices=[('1', 'Exercises'), ('2', 'Ingredients')], editable=False, max_length=2), + ), + ] diff --git a/wger/core/migrations/0010_auto_20170428_2135.py b/wger/core/migrations/0010_auto_20170428_2135.py new file mode 100644 index 0000000..06f2fa6 --- /dev/null +++ b/wger/core/migrations/0010_auto_20170428_2135.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.13 on 2017-04-28 18:35 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0009_auto_20160303_2340'), + ] + + operations = [ + migrations.AlterField( + model_name='license', + name='full_name', + field=models.CharField(help_text='If a license has been localized, e.g. the Creative Commons licenses for the different countries, add them as separate entries here.', max_length=60, verbose_name='Full name'), + ), + ] diff --git a/wger/email/migrations/0002_auto_20170428_2135.py b/wger/email/migrations/0002_auto_20170428_2135.py new file mode 100644 index 0000000..a5dde33 --- /dev/null +++ b/wger/email/migrations/0002_auto_20170428_2135.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.13 on 2017-04-28 18:35 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('email', '0001_initial'), + ] + + operations = [ + migrations.AlterModelOptions( + name='log', + options={'ordering': ['-date']}, + ), + migrations.AlterField( + model_name='log', + name='gym', + field=models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, related_name='email_log', to='gym.Gym'), + ), + ] diff --git a/wger/exercises/migrations/0004_auto_20170428_2135.py b/wger/exercises/migrations/0004_auto_20170428_2135.py new file mode 100644 index 0000000..80d7907 --- /dev/null +++ b/wger/exercises/migrations/0004_auto_20170428_2135.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.13 on 2017-04-28 18:35 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('exercises', '0003_auto_20160921_2000'), + ] + + operations = [ + migrations.AlterField( + model_name='exercise', + name='equipment', + field=models.ManyToManyField(blank=True, to='exercises.Equipment', verbose_name='Equipment'), + ), + migrations.AlterField( + model_name='exercise', + name='muscles', + field=models.ManyToManyField(blank=True, to='exercises.Muscle', verbose_name='Primary muscles'), + ), + migrations.AlterField( + model_name='exercise', + name='muscles_secondary', + field=models.ManyToManyField(blank=True, related_name='secondary_muscles', to='exercises.Muscle', verbose_name='Secondary muscles'), + ), + migrations.AlterField( + model_name='exercise', + name='status', + field=models.CharField(choices=[('1', 'Pending'), ('2', 'Accepted'), ('3', 'Declined')], default='1', editable=False, max_length=2), + ), + migrations.AlterField( + model_name='exerciseimage', + name='is_main', + field=models.BooleanField(default=False, help_text='Tick the box if you want to set this image as the main one for the exercise (will be shown e.g. in the search). The first image is automatically marked by the system.', verbose_name='Main picture'), + ), + migrations.AlterField( + model_name='exerciseimage', + name='status', + field=models.CharField(choices=[('1', 'Pending'), ('2', 'Accepted'), ('3', 'Declined')], default='1', editable=False, max_length=2), + ), + ] diff --git a/wger/gym/migrations/0007_auto_20170428_2135.py b/wger/gym/migrations/0007_auto_20170428_2135.py new file mode 100644 index 0000000..e45c985 --- /dev/null +++ b/wger/gym/migrations/0007_auto_20170428_2135.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.13 on 2017-04-28 18:35 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('gym', '0006_auto_20160214_1013'), + ] + + operations = [ + migrations.AlterModelOptions( + name='gym', + options={'ordering': ['name'], 'permissions': (('gym_trainer', 'Trainer: can see the users for a gym'), ('manage_gym', 'Admin: can manage users for a gym'), ('manage_gyms', 'Admin: can administrate the different gyms'))}, + ), + migrations.AlterField( + model_name='contract', + name='options', + field=models.ManyToManyField(blank=True, to='gym.ContractOption', verbose_name='Options'), + ), + migrations.AlterField( + model_name='gymadminconfig', + name='overview_inactive', + field=models.BooleanField(default=True, help_text='Receive email overviews of inactive members', verbose_name='Overview of inactive members'), + ), + migrations.AlterField( + model_name='gymconfig', + name='weeks_inactive', + field=models.PositiveIntegerField(default=4, help_text='Number of weeks since the last time a user logged his presence to be considered inactive', verbose_name='Reminder of inactive members'), + ), + ] diff --git a/wger/manager/migrations/0008_auto_20170428_2135.py b/wger/manager/migrations/0008_auto_20170428_2135.py new file mode 100644 index 0000000..beeb8ba --- /dev/null +++ b/wger/manager/migrations/0008_auto_20170428_2135.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.13 on 2017-04-28 18:35 +from __future__ import unicode_literals + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('manager', '0007_auto_20160311_2258'), + ] + + operations = [ + migrations.AlterField( + model_name='setting', + name='reps', + field=models.IntegerField(validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(600)], verbose_name='Amount'), + ), + ] diff --git a/wger/nutrition/migrations/0002_auto_20170428_2135.py b/wger/nutrition/migrations/0002_auto_20170428_2135.py new file mode 100644 index 0000000..8d4bf55 --- /dev/null +++ b/wger/nutrition/migrations/0002_auto_20170428_2135.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.13 on 2017-04-28 18:35 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('nutrition', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='ingredient', + name='status', + field=models.CharField(choices=[('1', 'Pending'), ('2', 'Accepted'), ('3', 'Declined'), ('4', 'Submitted by administrator'), ('5', 'System ingredient')], default='1', editable=False, max_length=2), + ), + migrations.AlterField( + model_name='meal', + name='order', + field=models.IntegerField(blank=True, editable=False, verbose_name='Order'), + ), + migrations.AlterField( + model_name='mealitem', + name='order', + field=models.IntegerField(blank=True, editable=False, verbose_name='Order'), + ), + ] diff --git a/wger/settings.py b/wger/settings.py index d07b73b..2e41232 100644 --- a/wger/settings.py +++ b/wger/settings.py @@ -15,17 +15,17 @@ DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': '/Users/Upendo/wger-bau-meister/wger/database.sqlite', - 'USER': '', + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'test_wger', + 'USER': 'postgres', 'PASSWORD': '', - 'HOST': '', + 'HOST': '127.0.0.1', 'PORT': '', } } # Make this unique, and don't share it with anybody. -SECRET_KEY = '^==kfubx+&ny@ee^(m^o7mcppw)8_3^5&n!0-+@#e2ophlh*1u' +SECRET_KEY = ')l-&5vesx6hf*(2v-cu28j)+gt_13^(n*e*4r9d3j#(nblgv67' # Your reCaptcha keys RECAPTCHA_PUBLIC_KEY = '' From 5ff0282ff89c0be01b55a0abd1dd344e04888237 Mon Sep 17 00:00:00 2001 From: Paul Upendo Date: Tue, 2 May 2017 09:28:36 +0300 Subject: [PATCH 08/18] Remove files on gitignore from remote --- .DS_Store | Bin 6148 -> 0 bytes wger/settings.py | 59 ----------------------------------------------- 2 files changed, 59 deletions(-) delete mode 100644 .DS_Store delete mode 100644 wger/settings.py diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 1363fbc9b4fd36282e9c8096a9095db3a19d480f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~L2AQ53`M_EF9O+k+2w3{fZkvT$q90S(7JRJ2qc7T=ji#;Xj8ZAV9FOrZ=|uX z{TCh!fNgKnJ1_!R)17$pFf(I5;Er#6;WAx6Pao&=$&0jA2Rx;ZnC<7bAO)m=6p#W^ zKng5Kfjq|7n*}|S9z_aBfn_M*--kkX)@199PX|Mc0OY`O7}qgNki`pRO}0)}XqMB1 zWvj&);`L}JOI}x#t+Thoa`>>kv-uQ5v)&FXOlVdE3Q|A{%oKR(`RM2Wp8nVTKWkAc z1*E_~Q^1DZVYlT=<=Oh{^}K$}s;?WJjLR8*`~)!Zqxh8`#{J?8vL;(6D>VHGgbWH& I;He5c0Kioex&QzG diff --git a/wger/settings.py b/wger/settings.py deleted file mode 100644 index 2e41232..0000000 --- a/wger/settings.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from wger.settings_global import * - -# Use 'DEBUG = True' to get more details for server errors -DEBUG = True -TEMPLATES[0]['OPTIONS']['debug'] = True - -ADMINS = ( - ('Your name', 'your_email@example.com'), -) -MANAGERS = ADMINS - - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'test_wger', - 'USER': 'postgres', - 'PASSWORD': '', - 'HOST': '127.0.0.1', - 'PORT': '', - } -} - -# Make this unique, and don't share it with anybody. -SECRET_KEY = ')l-&5vesx6hf*(2v-cu28j)+gt_13^(n*e*4r9d3j#(nblgv67' - -# Your reCaptcha keys -RECAPTCHA_PUBLIC_KEY = '' -RECAPTCHA_PRIVATE_KEY = '' -NOCAPTCHA = True - -# The site's URL (e.g. http://www.my-local-gym.com or http://localhost:8000) -# This is needed for uploaded files and images (exercise images, etc.) to be -# properly served. -SITE_URL = 'http://localhost:8000' - -# Path to uploaded files -# Absolute filesystem path to the directory that will hold user-uploaded files. -MEDIA_ROOT = '/Users/Upendo/.local/share/wger/media' -MEDIA_URL = '/media/' - -# Allow all hosts to access the application. Change if used in production. -ALLOWED_HOSTS = '*' - -# This might be a good idea if you setup memcached -#SESSION_ENGINE = "django.contrib.sessions.backends.cache" - -# Configure a real backend in production -if DEBUG: - EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' - -# Sender address used for sent emails -WGER_SETTINGS['EMAIL_FROM'] = 'wger Workout Manager ' - -# Your twitter handle, if you have one for this instance. -#WGER_SETTINGS['TWITTER'] = '' From 2060c09adefa4478dd38592f4400c686403ce1bf Mon Sep 17 00:00:00 2001 From: Paul Upendo Date: Tue, 2 May 2017 15:42:44 +0300 Subject: [PATCH 09/18] Link button to export function --- wger/manager/urls.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wger/manager/urls.py b/wger/manager/urls.py index 9de289b..0a9ff7e 100644 --- a/wger/manager/urls.py +++ b/wger/manager/urls.py @@ -52,6 +52,9 @@ url(r'^add$', workout.add, name='add'), + url(r'^export$', + workout.export_workout, + name='export'), url(r'^(?P\d+)/copy/$', workout.copy_workout, name='copy'), From db315309d814b42193de354311c89e997880b738 Mon Sep 17 00:00:00 2001 From: Paul Upendo Date: Tue, 2 May 2017 15:43:35 +0300 Subject: [PATCH 10/18] Add html and relevant css classes for export button --- wger/manager/templates/workout/overview.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wger/manager/templates/workout/overview.html b/wger/manager/templates/workout/overview.html index f8e3721..a01e25f 100644 --- a/wger/manager/templates/workout/overview.html +++ b/wger/manager/templates/workout/overview.html @@ -33,4 +33,7 @@

{{ workout }}

{% trans "Add workout" %} + + {% trans "Export Workout" %} + {% endblock %} From b842b9583d55729136fb22ad09fb9639d7ff7493 Mon Sep 17 00:00:00 2001 From: Paul Upendo Date: Tue, 2 May 2017 15:44:12 +0300 Subject: [PATCH 11/18] Create export workout fxn --- wger/manager/views/workout.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wger/manager/views/workout.py b/wger/manager/views/workout.py index a14e1ee..b7badac 100644 --- a/wger/manager/views/workout.py +++ b/wger/manager/views/workout.py @@ -121,6 +121,11 @@ def view(request, pk): return render(request, 'workout/view.html', template_data) +@login_required +def export_workout(): + pass + + @login_required def copy_workout(request, pk): ''' From e11708a19876468d0e2357bb73024f98b4a482d8 Mon Sep 17 00:00:00 2001 From: Paul Upendo Date: Thu, 4 May 2017 14:04:32 +0300 Subject: [PATCH 12/18] Add export-workout option on UI. Implement feature functionality --- wger/core/templates/form2.html | 46 ++++++++++++++++++++ wger/manager/forms.py | 6 +++ wger/manager/templates/workout/overview.html | 3 -- wger/manager/templates/workout/view.html | 6 +++ wger/manager/urls.py | 4 +- wger/manager/views/workout.py | 45 ++++++++++++++++--- workout.txt | 1 + workouts.txt | 0 8 files changed, 101 insertions(+), 10 deletions(-) create mode 100644 wger/core/templates/form2.html create mode 100644 workout.txt create mode 100644 workouts.txt diff --git a/wger/core/templates/form2.html b/wger/core/templates/form2.html new file mode 100644 index 0000000..ab4851a --- /dev/null +++ b/wger/core/templates/form2.html @@ -0,0 +1,46 @@ +{% extends extend_template %} +{% load i18n staticfiles wger_extras django_bootstrap_breadcrumbs %} + +{# #} +{# Breadcrumbs #} +{# #} +{% block breadcrumbs %} + {{ block.super }} + + {% breadcrumb "Exporting and importing workouts enables you & friends to share custom workouts." workout.pk%} +{% endblock %} + +{% block header %} + +{{ form.media }} + +{% if custom_js %} + +{% endif %} +{% endblock %} + + +{% block title %}{{title}}{% endblock %} + + +{% block content %} + +
+ {% render_form_fields form submit_text %} +
+ +{% endblock %} + + + + +{% block sidebar %}{% if sidebar %}{% include sidebar %} +{% endif %}{% endblock %} diff --git a/wger/manager/forms.py b/wger/manager/forms.py index c8cc6c6..aa7a487 100644 --- a/wger/manager/forms.py +++ b/wger/manager/forms.py @@ -76,6 +76,12 @@ class WorkoutCopyForm(Form): required=False) +class WorkoutExportForm(Form): + comment = CharField(max_length=100, + help_text=_('Give a title to this workout export.'), + required=False) + + class DayForm(ModelForm): class Meta: model = Day diff --git a/wger/manager/templates/workout/overview.html b/wger/manager/templates/workout/overview.html index a01e25f..f8e3721 100644 --- a/wger/manager/templates/workout/overview.html +++ b/wger/manager/templates/workout/overview.html @@ -33,7 +33,4 @@

{{ workout }}

{% trans "Add workout" %} - - {% trans "Export Workout" %} - {% endblock %} diff --git a/wger/manager/templates/workout/view.html b/wger/manager/templates/workout/view.html index 9e14ae8..4b28c05 100644 --- a/wger/manager/templates/workout/view.html +++ b/wger/manager/templates/workout/view.html @@ -251,6 +251,12 @@ {% trans "Make a copy of this workout" %} +
  • + + + {% trans "Export this workout" %} + +
  • {% if is_owner %}
  • diff --git a/wger/manager/urls.py b/wger/manager/urls.py index 0a9ff7e..977f3e0 100644 --- a/wger/manager/urls.py +++ b/wger/manager/urls.py @@ -52,8 +52,8 @@ url(r'^add$', workout.add, name='add'), - url(r'^export$', - workout.export_workout, + url(r'^(?P\d+)/export/$', + workout.export, name='export'), url(r'^(?P\d+)/copy/$', workout.copy_workout, diff --git a/wger/manager/views/workout.py b/wger/manager/views/workout.py index b7badac..79e0709 100644 --- a/wger/manager/views/workout.py +++ b/wger/manager/views/workout.py @@ -19,13 +19,17 @@ import datetime from django.shortcuts import render, get_object_or_404 -from django.http import HttpResponseRedirect, HttpResponseForbidden +from django.http import HttpResponseRedirect, HttpResponseForbidden, HttpResponse from django.template.context_processors import csrf from django.core.urlresolvers import reverse, reverse_lazy from django.utils.translation import ugettext_lazy, ugettext as _ from django.contrib.auth.mixins import PermissionRequiredMixin, LoginRequiredMixin from django.contrib.auth.decorators import login_required from django.views.generic import DeleteView, UpdateView +from django.core import serializers + + +import json from wger.core.models import ( RepetitionUnit, @@ -41,7 +45,8 @@ from wger.manager.forms import ( WorkoutForm, WorkoutSessionHiddenFieldsForm, - WorkoutCopyForm + WorkoutCopyForm, + WorkoutExportForm ) from wger.utils.generic_views import ( WgerFormMixin, @@ -49,6 +54,8 @@ ) from wger.utils.helpers import make_token +from wger.manager.api import resources + logger = logging.getLogger(__name__) @@ -121,9 +128,37 @@ def view(request, pk): return render(request, 'workout/view.html', template_data) -@login_required -def export_workout(): - pass +def export(request, pk): + workout = get_object_or_404(Workout, pk=pk) + user = workout.user + is_owner = request.user == user + + if not is_owner and not user.userprofile.ro_access: + return HttpResponseForbidden() + + # Process request + if request.method == 'POST': + workout_export_form = WorkoutExportForm(request.POST) + + data = serializers.serialize('json', Workout.objects.filter(user=request.user)) + response = HttpResponse(data, content_type='application/force-download') + response['Content-Disposition'] = 'attachment; filename="workouts.json"' + + return response + + else: + workout_export_form = WorkoutExportForm({'comment': workout.comment}) + + template_data = {} + template_data.update(csrf(request)) + template_data['title'] = _('Export Workout') + template_data['form'] = workout_export_form + template_data['form_action'] = reverse('manager:workout:export', kwargs={'pk': workout.id}) + template_data['form_fields'] = [workout_export_form['comment']] + template_data['submit_text'] = _('Export') + template_data['extend_template'] = 'base_empty.html' if request.is_ajax() else 'base.html' + + return render(request, 'form2.html', template_data) @login_required diff --git a/workout.txt b/workout.txt new file mode 100644 index 0000000..07de27d --- /dev/null +++ b/workout.txt @@ -0,0 +1 @@ +{"workouts": \ No newline at end of file diff --git a/workouts.txt b/workouts.txt new file mode 100644 index 0000000..e69de29 From d847b3cacd29bff650a03c92d5f0c2ad9c35fe8a Mon Sep 17 00:00:00 2001 From: Paul Upendo Date: Mon, 8 May 2017 10:25:16 +0300 Subject: [PATCH 13/18] Create exportworkout form. --- wger/manager/templates/workout/overview.html | 1 + wger/manager/templates/workout/view.html | 6 ++++++ wger/manager/urls.py | 3 +++ wger/manager/views/workout.py | 14 +++++++++++--- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/wger/manager/templates/workout/overview.html b/wger/manager/templates/workout/overview.html index f8e3721..a787309 100644 --- a/wger/manager/templates/workout/overview.html +++ b/wger/manager/templates/workout/overview.html @@ -33,4 +33,5 @@

    {{ workout }}

    {% trans "Add workout" %} + {% endblock %} diff --git a/wger/manager/templates/workout/view.html b/wger/manager/templates/workout/view.html index 4b28c05..a58fefc 100644 --- a/wger/manager/templates/workout/view.html +++ b/wger/manager/templates/workout/view.html @@ -256,6 +256,12 @@ {% trans "Export this workout" %} +
  • +
  • + + + {% trans "Import custom workout" %} +
  • {% if is_owner %} diff --git a/wger/manager/urls.py b/wger/manager/urls.py index 977f3e0..ea9a55c 100644 --- a/wger/manager/urls.py +++ b/wger/manager/urls.py @@ -55,6 +55,9 @@ url(r'^(?P\d+)/export/$', workout.export, name='export'), + url(r'^(?P\d+)/imports/$', + workout.imports, + name='imports'), url(r'^(?P\d+)/copy/$', workout.copy_workout, name='copy'), diff --git a/wger/manager/views/workout.py b/wger/manager/views/workout.py index 79e0709..5a6bd82 100644 --- a/wger/manager/views/workout.py +++ b/wger/manager/views/workout.py @@ -128,24 +128,32 @@ def view(request, pk): return render(request, 'workout/view.html', template_data) +@login_required +def imports(request, pk): + pass + + +@login_required def export(request, pk): + ''' + Exports workouts as json + ''' + workout = get_object_or_404(Workout, pk=pk) user = workout.user is_owner = request.user == user if not is_owner and not user.userprofile.ro_access: return HttpResponseForbidden() - # Process request if request.method == 'POST': - workout_export_form = WorkoutExportForm(request.POST) + # workout_export_form = WorkoutExportForm(request.POST) data = serializers.serialize('json', Workout.objects.filter(user=request.user)) response = HttpResponse(data, content_type='application/force-download') response['Content-Disposition'] = 'attachment; filename="workouts.json"' return response - else: workout_export_form = WorkoutExportForm({'comment': workout.comment}) From 97539b6288625b8c4f8bfbfd8e15ae76f96a09a4 Mon Sep 17 00:00:00 2001 From: Paul_upendo Date: Mon, 8 May 2017 11:21:28 +0300 Subject: [PATCH 14/18] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index ef974a0..dcac019 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,7 @@ env: # Install the application install: + - easy_install six # Update nvm and set wanted Node version. # We update nvm using the script method instead of git, which is selected # automatically, as git won't work because the $HOME/.nvm is not a git From 610682ad7a8dbc4350f8bbfe7f7c07cd4ab52bd9 Mon Sep 17 00:00:00 2001 From: Paul_upendo Date: Mon, 8 May 2017 11:26:59 +0300 Subject: [PATCH 15/18] Update .travis.yml --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index dcac019..31d12bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ env: # Install the application install: - - easy_install six + # Update nvm and set wanted Node version. # We update nvm using the script method instead of git, which is selected # automatically, as git won't work because the $HOME/.nvm is not a git @@ -37,8 +37,9 @@ install: - . $HOME/.nvm/nvm.sh - nvm install $TRAVIS_NODE_VERSION - nvm use $TRAVIS_NODE_VERSION - + # Install requirements + - pip install six - pip install -r requirements_devel.txt - npm install - if [[ "$DB" = "postgresql" ]]; then pip install psycopg2; fi From 3a8f8e638e984032646f06ca3b854e3434f7d5ff Mon Sep 17 00:00:00 2001 From: Paul Upendo Date: Fri, 26 May 2017 10:21:55 +0300 Subject: [PATCH 16/18] Fix travis configs --- .travis.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index ef974a0..1aecda9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,9 +14,9 @@ sudo: false # Python versions to test python: - - "2.7" - - "3.4" - - "3.5" + # - "2.7" + - "3.6" + # Manually define here the combinations environment variables to test # https://github.com/travis-ci/travis-ci/issues/1519 @@ -37,6 +37,9 @@ install: - nvm install $TRAVIS_NODE_VERSION - nvm use $TRAVIS_NODE_VERSION + # upgrade setuptools separately to avoid race condition + - pip install -U setuptools + # Install requirements - pip install -r requirements_devel.txt - npm install @@ -60,8 +63,8 @@ script: - gulp lint # Regular application - - coverage run --source='.' ./manage.py test + - coverage run --source='wger' ./manage.py test # Code coverage - - coverage report + - coverage report \ No newline at end of file From 5b6bff84d8c4f61afc7c99a03886dc2cad74eba1 Mon Sep 17 00:00:00 2001 From: Paul Upendo Date: Fri, 26 May 2017 10:22:54 +0300 Subject: [PATCH 17/18] Fix pep8 errors --- logfile | 2 ++ wger/manager/views/workout.py | 3 +-- wger/utils/language.py | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 logfile diff --git a/logfile b/logfile new file mode 100644 index 0000000..91145fc --- /dev/null +++ b/logfile @@ -0,0 +1,2 @@ +FATAL: pre-existing shared memory block (key 5432001, ID 262144) is still in use +HINT: If you're sure there are no old server processes still running, remove the shared memory block or just delete the file "postmaster.pid". diff --git a/wger/manager/views/workout.py b/wger/manager/views/workout.py index 5a6bd82..7390043 100644 --- a/wger/manager/views/workout.py +++ b/wger/manager/views/workout.py @@ -151,8 +151,7 @@ def export(request, pk): data = serializers.serialize('json', Workout.objects.filter(user=request.user)) response = HttpResponse(data, content_type='application/force-download') - response['Content-Disposition'] = 'attachment; filename="workouts.json"' - + response['Content-Disposition'] = 'attachment; filename="workouts.json"' return response else: workout_export_form = WorkoutExportForm({'comment': workout.comment}) diff --git a/wger/utils/language.py b/wger/utils/language.py index f8975d5..79078c4 100644 --- a/wger/utils/language.py +++ b/wger/utils/language.py @@ -51,7 +51,6 @@ def load_language(language_code=None): try: language, is_created = Language.objects.get_or_create(short_name=used_language) # language = Language.objects.get(short_name=used_language) - except ObjectDoesNotExist: # No luck, load english as our fall-back language language = Language.objects.get(short_name="en") From fc09beb32985f23ee5a3701c86f0af934684e7d9 Mon Sep 17 00:00:00 2001 From: Paul_upendo Date: Fri, 26 May 2017 10:27:15 +0300 Subject: [PATCH 18/18] Update .travis.yml --- .travis.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index a000d4a..e7d2845 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,6 @@ env: # Install the application install: - # Update nvm and set wanted Node version. # We update nvm using the script method instead of git, which is selected # automatically, as git won't work because the $HOME/.nvm is not a git @@ -37,16 +36,11 @@ install: - . $HOME/.nvm/nvm.sh - nvm install $TRAVIS_NODE_VERSION - nvm use $TRAVIS_NODE_VERSION -<<<<<<< HEAD # upgrade setuptools separately to avoid race condition - pip install -U setuptools -======= - ->>>>>>> 610682ad7a8dbc4350f8bbfe7f7c07cd4ab52bd9 # Install requirements - - pip install six - pip install -r requirements_devel.txt - npm install - if [[ "$DB" = "postgresql" ]]; then pip install psycopg2; fi @@ -73,4 +67,4 @@ script: # Code coverage - - coverage report \ No newline at end of file + - coverage report