Skip to content

Commit

Permalink
Merge pull request #145 from fga-gpp-mds/devel
Browse files Browse the repository at this point in the history
US29-AddProfileImage
  • Loading branch information
maugustoo authored Nov 6, 2017
2 parents 751b542 + e9a7999 commit 03221a6
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 4 deletions.
9 changes: 9 additions & 0 deletions medical_prescription/medical_prescription/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,12 @@
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static/'),
]


# Media Files
MEDIA_URL = '/public/'

MEDIA_ROOT = os.path.join(
os.path.dirname(__file__),
'../public',
)
6 changes: 4 additions & 2 deletions medical_prescription/medical_prescription/urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from django.conf.urls.i18n import i18n_patterns
from django.conf.urls.static import static
from django.conf.urls import include, url
from django.contrib import admin

from landing.views import home

from medical_prescription import settings
urlpatterns = [
url(r'^user/', include('user.urls')),
url(r'^dashboard_health_professional/', include('dashboardHealthProfessional.urls')),
Expand All @@ -17,7 +18,8 @@
url(r'^prescription/', include('prescription.urls')),
url(r'^chat/', include('chat.urls')),
url(r'^recommendation/', include('recommendation.urls')),
]
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


urlpatterns += i18n_patterns(
url(r'^user/', include('user.urls')),
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
<li><a href="{% url 'create_custom_exams' %}">{% trans "Exame"%}</a></li>
<li><a href="{% url 'create_medicine' %}">{% trans "Medicamento"%}</a></li>
<li><a href="{% url 'create_activePrinciple' %}">{% trans "Princípio ativo"%}</a></li>
<li><a href="{% url 'create_activePrinciple' %}">{% trans "Princípio ativo"%}</a></li>
<li><a href="{% url 'create_custom_recomendation' %}">Recomendações Customizadas</a></li>
</ul>
</li>
Expand Down
3 changes: 3 additions & 0 deletions medical_prescription/user/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,6 @@
LINKED_PATIENT_SUCESS = 'O paciente foi adicionado à sua lista de pacientes.'
LINKED_PATIENT_EXISTS = 'O paciente já está adicionado em sua lista de pacientes.'
ALERT_HEALTH_PROFESSIONAL = 'Esta conta pertence a um professional da saúde.'

# DEFAULT PATH IMAGE.
DEFAULT_IMG = 'image_profile/user.png'
2 changes: 1 addition & 1 deletion medical_prescription/user/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from django.contrib.auth.base_user import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.db import models

# Local Django
from .usermanager import UserManager
from user import constants
Expand All @@ -17,6 +16,7 @@ class User(AbstractBaseUser, PermissionsMixin):
phone = models.CharField(max_length=constants.PHONE_NUMBER_FIELD_LENGTH_MAX, blank=True, default='00000000000')
email = models.EmailField(unique=True)
sex = models.CharField(choices=constants.SEX_CHOICE, max_length=10, default=constants.SEX_M)
image_profile = models.ImageField(upload_to='image_profile/', default=constants.DEFAULT_IMG)

is_active = models.BooleanField(default=False)
is_staff = models.BooleanField(default=False)
Expand Down
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ dj-static==0.0.6
python-decouple==3.0
django-widget-tweaks==1.4.1
django-localflavor==1.5.0
Pillow==4.2.1

0 comments on commit 03221a6

Please sign in to comment.