Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENG-5453] don't update last updated on project's page when log.should_hide=True #10943

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions osf/models/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,14 @@ def add_log(self, action, params, auth, foreign_user=None, log_date=None, save=T
def _complete_add_log(self, log, action, user=None, save=True):
if self.logs.count() == 1:
log_date = log.date if hasattr(log, 'date') else log.created
self.last_logged = log_date.replace(tzinfo=pytz.utc)
last_logged = log_date.replace(tzinfo=pytz.utc)
else:
recent_log = self.logs.first()
recent_log = self.logs.latest('created')
log_date = recent_log.date if hasattr(log, 'date') else recent_log.created
self.last_logged = log_date
last_logged = log_date

if not log.should_hide:
self.last_logged = last_logged

if save:
self.save()
Expand Down
Loading