Fixed linting
Browse files- app.py +9 -7
- postly/common/models.py +4 -2
app.py
CHANGED
|
@@ -134,7 +134,7 @@ def get_all_posts():
|
|
| 134 |
for user_name, post in sorted_posts:
|
| 135 |
liked = st.session_state.current_user in post.liked_by
|
| 136 |
like_button_label = "π" if not liked else "π"
|
| 137 |
-
|
| 138 |
col1, col2 = st.columns([4, 1])
|
| 139 |
with col1:
|
| 140 |
st.markdown(
|
|
@@ -153,6 +153,7 @@ def get_all_posts():
|
|
| 153 |
client.like_post(st.session_state.current_user, post.timestamp)
|
| 154 |
st.rerun()
|
| 155 |
|
|
|
|
| 156 |
def main():
|
| 157 |
st.sidebar.title("Postly π\nSimple social media platform")
|
| 158 |
|
|
@@ -188,14 +189,16 @@ def main():
|
|
| 188 |
register()
|
| 189 |
elif page == "Login":
|
| 190 |
login()
|
| 191 |
-
|
| 192 |
-
st.sidebar.markdown(
|
|
|
|
| 193 |
**About Postly**
|
| 194 |
-
|
| 195 |
-
Welcome to Postly, a simple social media platform created for fun.
|
|
|
|
| 196 |
|
| 197 |
**Important Information**
|
| 198 |
-
|
| 199 |
- The entire app is kept in global memory for all users accessing the app on the same instance.
|
| 200 |
- Do not use a username and password actually used with any other apps.
|
| 201 |
- We hash the password, but no real attempt to make a bulletproof solution was made.
|
|
@@ -203,6 +206,5 @@ def main():
|
|
| 203 |
)
|
| 204 |
|
| 205 |
|
| 206 |
-
|
| 207 |
if __name__ == "__main__":
|
| 208 |
main()
|
|
|
|
| 134 |
for user_name, post in sorted_posts:
|
| 135 |
liked = st.session_state.current_user in post.liked_by
|
| 136 |
like_button_label = "π" if not liked else "π"
|
| 137 |
+
|
| 138 |
col1, col2 = st.columns([4, 1])
|
| 139 |
with col1:
|
| 140 |
st.markdown(
|
|
|
|
| 153 |
client.like_post(st.session_state.current_user, post.timestamp)
|
| 154 |
st.rerun()
|
| 155 |
|
| 156 |
+
|
| 157 |
def main():
|
| 158 |
st.sidebar.title("Postly π\nSimple social media platform")
|
| 159 |
|
|
|
|
| 189 |
register()
|
| 190 |
elif page == "Login":
|
| 191 |
login()
|
| 192 |
+
|
| 193 |
+
st.sidebar.markdown(
|
| 194 |
+
"""
|
| 195 |
**About Postly**
|
| 196 |
+
|
| 197 |
+
Welcome to Postly, a simple social media platform created for fun.
|
| 198 |
+
This app allows different users to share posts and like each other's posts.
|
| 199 |
|
| 200 |
**Important Information**
|
| 201 |
+
|
| 202 |
- The entire app is kept in global memory for all users accessing the app on the same instance.
|
| 203 |
- Do not use a username and password actually used with any other apps.
|
| 204 |
- We hash the password, but no real attempt to make a bulletproof solution was made.
|
|
|
|
| 206 |
)
|
| 207 |
|
| 208 |
|
|
|
|
| 209 |
if __name__ == "__main__":
|
| 210 |
main()
|
postly/common/models.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
-
from dataclasses import dataclass
|
| 2 |
-
from
|
|
|
|
|
|
|
| 3 |
|
| 4 |
from pydantic import BaseModel
|
| 5 |
|
|
|
|
| 1 |
+
from dataclasses import dataclass
|
| 2 |
+
from dataclasses import field
|
| 3 |
+
from typing import List
|
| 4 |
+
from typing import Set
|
| 5 |
|
| 6 |
from pydantic import BaseModel
|
| 7 |
|