post merge commit

sync3
Razmig Sarkissian 5 months ago
commit a641fcced4
  1. 5
      padelclub_backend/settings.py
  2. 3
      sync/admin.py

@ -168,6 +168,9 @@ AUTHENTICATION_BACKENDS = [
CSRF_COOKIE_SECURE = True # if using HTTPS CSRF_COOKIE_SECURE = True # if using HTTPS
SESSION_COOKIE_SECURE = True SESSION_COOKIE_SECURE = True
LOGS_DIR = os.path.join(BASE_DIR, 'logs')
os.makedirs(LOGS_DIR, exist_ok=True)
LOGGING = { LOGGING = {
'version': 1, 'version': 1,
'disable_existing_loggers': False, 'disable_existing_loggers': False,
@ -196,7 +199,7 @@ LOGGING = {
'rotating_file': { 'rotating_file': {
'level': 'INFO', 'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler', 'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(BASE_DIR, 'django.log'), 'filename': os.path.join(LOGS_DIR, 'django.log'),
'maxBytes': 10 * 1024 * 1024, 'maxBytes': 10 * 1024 * 1024,
'backupCount': 10, 'backupCount': 10,
'formatter': 'verbose', 'formatter': 'verbose',

@ -4,6 +4,9 @@ from django.utils import timezone
from .models import BaseModel, ModelLog, DataAccess from .models import BaseModel, ModelLog, DataAccess
class SyncedObjectAdmin(admin.ModelAdmin): class SyncedObjectAdmin(admin.ModelAdmin):
exclude = ('data_access_ids',)
def save_model(self, request, obj, form, change): def save_model(self, request, obj, form, change):
if isinstance(obj, BaseModel): if isinstance(obj, BaseModel):
obj.last_updated_by = request.user obj.last_updated_by = request.user

Loading…
Cancel
Save