What was the issues?
1-The expire_at field is incorrectly set when editing.
This information was sent from the discord channel.
- Poll options include 1 week and 1 month. This is the time allowed to vote in the poll. A poll page is updated. It is automatically set to 1 month regardless of user preference.
2-Markdown type table data is not shown.
This information was sent from the discord channel. But it was advanced through github.
- When you create a table with Markdown, it occurs smoothly by the editor. However, there is no table support in html conversion in backend codes.
What was the solution?
1 - Fixed : https://github.com/emre/dpoll.xyz/pull/58
@property def expire_at_humanized(self): diff_in_days = (self.expire_at - self.created_at).days if diff_in_days == 7: return "1_week" else: return "1_month"
The result of this value(
diff_in_days) is generally around 6.95. The value of 6 is accepted because it is questioned as the day. I needed a proper check here. I updated the query as 7 days or less.
if diff_in_days <= 7:
- I also removed an unnecessary variable.
2 - Fixed : https://github.com/emre/dpoll.xyz/pull/69
- I've added table support at the backend.
md.markdown(value, extensions=['markdown.extensions.fenced_code', 'markdown.extensions.tables'])
- I added the class to the table element for bootstrap framework.
$('table').addClass('table'); ( I love jquery.)