Skip to content

Commit

Permalink
Social authentication setting on setting-global.py, url.py, login.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmedsebit authored and Ahmedsebit committed May 4, 2017
1 parent fc9728e commit 2e8bf6f
Show file tree
Hide file tree
Showing 15 changed files with 300 additions and 6 deletions.
65 changes: 65 additions & 0 deletions -u
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
alabaster==0.7.10
appdirs==1.4.3
Babel==2.4.0
bleach==2.0.0
coverage==4.3.4
defusedxml==0.5.0
dj-database-url==0.4.2
dj-static==0.0.6
Django==1.9.13
django-appconf==1.0.2
django-bootstrap-breadcrumbs==0.8.2
django-bower==5.2.0
django-compressor==2.1.1
django-cors-headers==2.0.2
django-debug-toolbar==1.7
django-filter==1.0.2
django-formtools==1.0
django-mobile==0.7.0
django-recaptcha==1.3.0
django-sortedm2m==1.3.3
django-tastypie==0.13.3
djangorestframework==3.2.5
docutils==0.13.1
easy-thumbnails==2.4.1
future==0.16.0
gunicorn==19.7.1
html5lib==0.999999999
icalendar==3.11.3
imagesize==0.7.1
invoke==0.16.3
Jinja2==2.9.6
Markdown==2.6.8
MarkupSafe==1.0
oauthlib==2.0.2
olefile==0.44
packaging==16.8
pep8==1.7.0
Pillow==4.1.0
psycopg2==2.7.1
pycryptodomex==3.4.5
Pygments==2.2.0
pyjwkest==1.3.2
PyJWT==1.5.0
pyparsing==2.2.0
python-dateutil==2.6.0
python-decouple==3.0
python-mimeparse==1.6.0
python-social-auth==0.3.6
python3-openid==3.1.0
pytz==2017.2
rcssmin==1.0.6
reportlab==3.4.0
requests==2.13.0
requests-oauthlib==0.8.0
rjsmin==1.0.12
six==1.10.0
snowballstemmer==1.2.1
social-auth-app-django==1.1.0
social-auth-core==1.2.0
Sphinx==1.5.5
sqlparse==0.2.3
static3==0.7.0
Unipath==1.1
webencodings==0.5.1
whitenoise==3.3.0
Binary file modified .DS_Store
Binary file not shown.
21 changes: 21 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ alabaster==0.7.10
appdirs==1.4.3
Babel==2.4.0
bleach==2.0.0
coverage==4.3.4
defusedxml==0.5.0
dj-database-url==0.4.2
dj-static==0.0.6
Django==1.9.13
Expand All @@ -10,41 +12,60 @@ django-bootstrap-breadcrumbs==0.8.2
django-bower==5.2.0
django-compressor==2.1.1
django-cors-headers==2.0.2
django-debug-toolbar==1.7
django-filter==1.0.2
django-formtools==1.0
django-mobile==0.7.0
django-recaptcha==1.3.0
django-sortedm2m==1.3.3
django-tastypie==0.13.3
djangorestframework==3.2.5
docker==2.2.1
docker-pycreds==0.2.1
docutils==0.13.1
easy-thumbnails==2.4.1
future==0.16.0
gunicorn==19.7.1
html5lib==0.999999999
httplib2==0.10.3
icalendar==3.11.3
imagesize==0.7.1
invoke==0.16.3
Jinja2==2.9.6
Markdown==2.6.8
MarkupSafe==1.0
oauth2==1.9.0.post1
oauthlib==2.0.2
olefile==0.44
optional-django==0.1.0
packaging==16.8
pep8==1.7.0
Pillow==4.1.0
psycopg2==2.7.1
pycryptodomex==3.4.5
Pygments==2.2.0
pyjwkest==1.3.2
PyJWT==1.5.0
pyparsing==2.2.0
python-dateutil==2.6.0
python-decouple==3.0
python-mimeparse==1.6.0
python-social-auth==0.3.6
python3-openid==3.1.0
pytz==2017.2
rcssmin==1.0.6
reportlab==3.4.0
requests==2.13.0
requests-oauthlib==0.8.0
rjsmin==1.0.12
six==1.10.0
snowballstemmer==1.2.1
social-auth-app-django==1.1.0
social-auth-core==1.2.0
Sphinx==1.5.5
sqlparse==0.2.3
static3==0.7.0
Unipath==1.1
webencodings==0.5.1
websocket-client==0.40.0
whitenoise==3.3.0
5 changes: 5 additions & 0 deletions wger/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SOCIAL_AUTH_FACEBOOK_KEY = '860742220731257' # App ID
SOCIAL_AUTH_FACEBOOK_SECRET = '469f8c1b55a1ef1b95b672eb4f1a17e5'

SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/dashboard/'
SOCIAL_AUTH_LOGIN_URL = '/'
20 changes: 20 additions & 0 deletions wger/config/migrations/0002_auto_20170502_2341.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-05-02 20:41
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),
),
]
20 changes: 20 additions & 0 deletions wger/core/migrations/0010_auto_20170502_2341.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-05-02 20:41
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'),
),
]
4 changes: 1 addition & 3 deletions wger/core/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
{% block header %}
<script src="{% static 'js/weight.js' %}"></script>
{% endblock %}



{{ user.username }}
{% block content %}
{% if current_workout %}
<div class="modal fade" id="calendar-day-select-popup">
Expand Down
3 changes: 3 additions & 0 deletions wger/core/templates/user/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ <h4>{% trans "Forgot password?" %}</h4>
{% trans "Reset password" %}
</a>
</p>
<a href="{% url 'social:begin' 'twitter' %}?next={{ request.GET.next}}">Login with Twitter</a>
<br><a href="{% url 'social:begin' 'google-oauth2' %}?next={{ request.GET.next}}">Google+</a>
<br><a href="{% url 'social:begin' 'facebook' %}?next={{ request.GET.next}}">Login with Facebook</a>
{% endblock %}
3 changes: 0 additions & 3 deletions wger/core/views/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def login(request):
def delete(request, user_pk=None):
'''
Delete a user account and all his data, requires password confirmation first
If no user_pk is present, the user visiting the URL will be deleted, otherwise
a gym administrator is deleting a different user
'''
Expand Down Expand Up @@ -389,7 +388,6 @@ class UserEditView(WgerFormMixin,
def dispatch(self, request, *args, **kwargs):
'''
Check permissions
- Managers can edit members of their own gym
- General managers can edit every member
'''
Expand Down Expand Up @@ -456,7 +454,6 @@ class UserDetailView(LoginRequiredMixin, WgerMultiplePermissionRequiredMixin, De
def dispatch(self, request, *args, **kwargs):
'''
Check permissions
- Only managers for this gym can access the members
- General managers can access the detail page of all users
'''
Expand Down
25 changes: 25 additions & 0 deletions wger/email/migrations/0002_auto_20170502_2341.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-05-02 20:41
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'),
),
]
45 changes: 45 additions & 0 deletions wger/exercises/migrations/0004_auto_20170502_2341.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-05-02 20:41
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),
),
]
34 changes: 34 additions & 0 deletions wger/gym/migrations/0007_auto_20170502_2341.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-05-02 20:41
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'),
),
]
21 changes: 21 additions & 0 deletions wger/manager/migrations/0008_auto_20170502_2341.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-05-02 20:41
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'),
),
]
30 changes: 30 additions & 0 deletions wger/nutrition/migrations/0002_auto_20170502_2341.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-05-02 20:41
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'),
),
]
Loading

0 comments on commit 2e8bf6f

Please sign in to comment.