8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 11:23:10 +00:00

Correct django settings

This commit is contained in:
chiahetcho 2020-05-18 16:52:53 +02:00
parent a6e324bc60
commit 1ba03335e4

View file

@ -59,7 +59,7 @@ from machines.models import Machine
from preferences.models import OptionalUser, GeneralOption, AssoOption from preferences.models import OptionalUser, GeneralOption, AssoOption
from importlib import import_module from importlib import import_module
from re2o.settings import BASE_DIR from django.conf import settings
from re2o.settings_local import OPTIONNAL_APPS_RE2O from re2o.settings_local import OPTIONNAL_APPS_RE2O
from re2o.views import form from re2o.views import form
from re2o.utils import all_has_access, permission_tree from re2o.utils import all_has_access, permission_tree
@ -229,7 +229,7 @@ def edit_info(request, user, userid):
former_user = Adherent.objects.get(pseudo=user.pseudo) former_user = Adherent.objects.get(pseudo=user.pseudo)
if former_user.profile_image: if former_user.profile_image:
if (user.profile_image and user.profile_image.url != former_user.profile_image.url) or (not user.profile_image): if (user.profile_image and user.profile_image.url != former_user.profile_image.url) or (not user.profile_image):
former_image = BASE_DIR+former_user.profile_image.url former_image = settings.BASE_DIR+former_user.profile_image.url
os.remove(former_image) os.remove(former_image)
user = user_form.save() user = user_form.save()
messages.success(request, _("The user was edited.")) messages.success(request, _("The user was edited."))