Log history changes to console
This commit is contained in:
parent
e8557cbf37
commit
af3f4ac614
|
@ -421,6 +421,7 @@ class CardSerializer(serializers.ModelSerializer):
|
||||||
read_only_fields = [
|
read_only_fields = [
|
||||||
'id',
|
'id',
|
||||||
'last_seen',
|
'last_seen',
|
||||||
|
'last_seen_at',
|
||||||
'user',
|
'user',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ def post_create_historical_record_callback(
|
||||||
is_admin=is_admin_director(history_user),
|
is_admin=is_admin_director(history_user),
|
||||||
)
|
)
|
||||||
|
|
||||||
for change in changes:
|
for num, change in enumerate(changes):
|
||||||
change_old = str(change.old)
|
change_old = str(change.old)
|
||||||
change_new = str(change.new)
|
change_new = str(change.new)
|
||||||
|
|
||||||
|
@ -84,6 +84,18 @@ def post_create_historical_record_callback(
|
||||||
old=change_old,
|
old=change_old,
|
||||||
new=change_new,
|
new=change_new,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
logger.info('History - {} changed {}\'s {} {}/{}: {} "{}" --> "{}"'.format(
|
||||||
|
history_user or 'System',
|
||||||
|
owner[0],
|
||||||
|
object_name,
|
||||||
|
num+1,
|
||||||
|
len(changes),
|
||||||
|
change.field,
|
||||||
|
change_old,
|
||||||
|
change_new,
|
||||||
|
))
|
||||||
|
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
logger.error('History Signal - {} - {}'.format(e.__class__.__name__, e))
|
logger.error('History Signal - {} - {}'.format(e.__class__.__name__, e))
|
||||||
logger.info(str(sender))
|
logger.info(str(sender))
|
||||||
|
|
|
@ -24,5 +24,5 @@ class LoggingThrottle(throttling.BaseThrottle):
|
||||||
else:
|
else:
|
||||||
data = None
|
data = None
|
||||||
|
|
||||||
logging.info('Request User: %s | %s %s | Data: %s', user, method, path, data)
|
logging.info('Request - User: %s | %s %s | Data: %s', user, method, path, data)
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -158,7 +158,7 @@ def get_progress(request_id):
|
||||||
return cache.get('request-progress-' + request_id, [])
|
return cache.get('request-progress-' + request_id, [])
|
||||||
|
|
||||||
def set_progress(request_id, data):
|
def set_progress(request_id, data):
|
||||||
logger.info('Request %s progress: %s', request_id, data)
|
logger.info('Progress - ID: %s | Status: %s', request_id, data)
|
||||||
progress = get_progress(request_id)
|
progress = get_progress(request_id)
|
||||||
progress.append(data)
|
progress.append(data)
|
||||||
cache.set('request-progress-' + request_id, progress)
|
cache.set('request-progress-' + request_id, progress)
|
||||||
|
|
|
@ -475,7 +475,7 @@ class DoorViewSet(viewsets.ViewSet, List):
|
||||||
except models.Member.DoesNotExist:
|
except models.Member.DoesNotExist:
|
||||||
raise Http404
|
raise Http404
|
||||||
t = utils.now_alberta_tz().strftime('%Y-%m-%d %H:%M:%S, %a %I:%M %p')
|
t = utils.now_alberta_tz().strftime('%Y-%m-%d %H:%M:%S, %a %I:%M %p')
|
||||||
logger.info('Time: {} - Name: {} {} ({})'.format(t, member.first_name, member.last_name, member.id))
|
logger.info('Scan - Time: {} | Name: {} {} ({})'.format(t, member.first_name, member.last_name, member.id))
|
||||||
|
|
||||||
utils_stats.calc_card_scans()
|
utils_stats.calc_card_scans()
|
||||||
|
|
||||||
|
@ -651,7 +651,7 @@ class BackupView(views.APIView):
|
||||||
backup_user = secrets.BACKUP_TOKENS.get(auth_token, None)
|
backup_user = secrets.BACKUP_TOKENS.get(auth_token, None)
|
||||||
|
|
||||||
if backup_user:
|
if backup_user:
|
||||||
logger.info('Backup user: ' + backup_user['name'])
|
logger.info('Backup - User: ' + backup_user['name'])
|
||||||
backup_path = cache.get(backup_user['cache_key'], None)
|
backup_path = cache.get(backup_user['cache_key'], None)
|
||||||
|
|
||||||
if not backup_path:
|
if not backup_path:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user