Project

General

Profile

Task #2952 » 03-askapi_closed.patch

AskBot API: Expose closed status - Guilhem Moulin, 2021-03-30 13:38

View differences:

askbot/views/api_v1.py
48 48
        'text': question_post.text,
49 49
        'tags': thread.tagnames.strip().split(),
50 50
        'url': site_url(thread.get_absolute_url()),
51
        'closed': thread.closed,
51 52
    }
52 53
    datum['author'] = {
53 54
        'id': thread._question_post().author.id,
......
57 58
        'id': thread.last_activity_by.id,
58 59
        'username': thread.last_activity_by.username
59 60
    }
61
    if thread.closed:
62
        datum['closed_at'] = get_epoch_str(thread.closed_at)
63
        datum['closed_by'] = {
64
            'id': thread.closed_by.id,
65
            'username': thread.closed_by.username
66
        }
60 67
    return datum
61 68

  
62 69
def get_answer_data(post):
(3-3/6)