fedora-infra / fas

Fedora Account System
https://admin.fedoraproject.org/accounts
GNU General Public License v2.0
40 stars 50 forks source link

[FAS3] Profile account activities throwing an error on local instance #182

Closed skrzepto closed 7 years ago

skrzepto commented 8 years ago

Note: this works fine on http://fas3-dev.fedorainfracloud.org/people/profile/7/activities

Summary when viewing Account activities it throws an error AttributeError: 'PeopleAccountActivitiesLog' object has no attribute 'timestamp'

Steps to reproduce: on a local instance

  1. login to an account
  2. go to profile by clicking on avatar
  3. In Security click on Account activities

Expected Results I'd like to see the log just as the dev instance does.

Error Log

MakoRenderingException: 

Traceback (most recent call last):
  File "/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/pyramid_mako/__init__.py", line 148, in __call__
    result = template.render_unicode(**system)
  File "/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/mako/template.py", line 454, in render_unicode
    as_unicode=True)
  File "/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/mako/runtime.py", line 829, in _render
    **_kwargs_for_callable(callable_, data))
  File "/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/mako/runtime.py", line 864, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/home/skrzepto/.virtualenvs/fas-python2.7/lib/python2.7/site-packages/mako/runtime.py", line 890, in _exec_template
    callable_(context, *args, **kwargs)
  File "/home/skrzepto/Documents/repo/fas/fas/templates/fedoraproject/site.xhtml", line 154, in render_body
    ${self.body()}
  File "/home/skrzepto/Documents/repo/fas/fas/templates/fedoraproject/people/activities.xhtml", line 19, in render_body
    <td>${activity.get_date(request)}</td>
  File "/home/skrzepto/Documents/repo/fas/fas/models/people.py", line 304, in get_date
    return format_datetime(request.locale_name, self.timestamp)
AttributeError: 'PeopleAccountActivitiesLog' object has no attribute 'timestamp'
skrzepto commented 8 years ago

Looks like the db for people_activity_log uses event_timestamp instead of just timestamp

skrzepto commented 7 years ago

Fixed