Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFeature/user notes #120
Open
Feature/user notes #120
Conversation
| note = request.json.get('note') | ||
| user = User.get_or_none(request.json.get('user_id', 0)) | ||
|
|
||
| if not act or not user or note is None: |
This comment has been minimized.
This comment has been minimized.
| return fail(400, 'Invalid user_id or note') | ||
|
|
||
| if act == 'fetch': | ||
| return jsonify({user.note}) |
This comment has been minimized.
This comment has been minimized.
yammesicka
Jun 17, 2020
Member
Will it blend?
(Srsly though, you can just put user.note in there? Have you checked the API using Postman [or any similar tool]? What about the key?)
| @@ -93,6 +93,7 @@ class User(UserMixin, BaseModel): | |||
| mail_address = CharField(unique=True) | |||
| password = CharField() | |||
| role = ForeignKeyField(Role, backref='users') | |||
| note = CharField(max_length=4096, default='') | |||
This comment has been minimized.
This comment has been minimized.
yammesicka
Jun 17, 2020
Member
It should be many to one - each user should many notes (Notes -> User)
This comment has been minimized.
This comment has been minimized.
IdoElk
Jun 17, 2020
Author
Member
This was my initial thinking but then I was thinking about our actual usage.
Wouldn't we want to have a general note for a specific user? or am I missing the usecase?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
IdoElk commentedJun 15, 2020
Add user notes, backend only!