Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add discussion and discussion_entry models to backend #688

Merged
merged 8 commits into from
Apr 8, 2024

Conversation

anthonyshibitov
Copy link
Contributor

Contributor checklist


Description

movement_id and vote_id are currently not implemented, denoted by comments.

Let me know if there's any issues with this. This is my first foray into backend stuff 🤠

Related issue

movement_id and vote_id are currently not implemented, denoted
by comments.

Issue activist-org#619
Copy link

netlify bot commented Feb 5, 2024

Deploy Preview for activist-org ready!

Name Link
🔨 Latest commit ddfa97f
🔍 Latest deploy log https://app.netlify.com/sites/activist-org/deploys/66146b0dcbf2600008a328cc
😎 Deploy Preview https://deploy-preview-688--activist-org.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

github-actions bot commented Feb 5, 2024

Thank you for the pull request!

The activist team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and Development rooms once you're in. It'd be great to have you!

Maintainer checklist

  • The commit messages for the remote branch should be checked to make sure the contributor's email is set up correctly so that they receive credit for their contribution

    • The contributor's name and icon in remote commits should be the same as what appears in the PR
    • If there's a mismatch, the contributor needs to make sure that the email they use for GitHub matches what they have for git config user.email in their local activist repo
  • The TypeScript and formatting workflows within the PR checks do not indicate new errors in the files changed

  • The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

@anthonyshibitov
Copy link
Contributor Author

Not sure how to implement dummy models for movements and votes, hence the below backend fails:

backend/content/models.py:26: error: Cannot find model 'entities.Movement' referenced in field 'movement_id' [misc]
backend/content/models.py:29: error: Cannot find model 'events.Vote' referenced in field 'vote_id' [misc]

@andrewtavis
Copy link
Member

For now we'll just comment them out, @anthonyshibitov :) Thanks!

@andrewtavis
Copy link
Member

Ok, soooo, this is quite weird. @to-sta, the errors that are coming up now for the backend are what I was seeing in PyLint that we said were false positives 🤔 Can you take a look?

@to-sta
Copy link
Collaborator

to-sta commented Feb 19, 2024

Ok, soooo, this is quite weird. @to-sta, the errors that are coming up now for the backend are what I was seeing in PyLint that we said were false positives 🤔 Can you take a look?

Hi @andrewtavis, maybe its related but the backend workflow discovered static type issues and unsorted imports. Does pylint cover those?

I saw that inheritance was missing for the viewsets, that solves most of the static type issues.

class DiscussionViewSet:
     ...

class DiscussionViewSet(viewsets.ModelViewSet[Discussion]):
    ....

I think the rest of the static type issues are related to the use of model fields that don't exist.

@to-sta
Copy link
Collaborator

to-sta commented Apr 7, 2024

I fixed the mypy, linting and formatting issues. @andrewtavis and I renamed the user_id field from DicussionEntry to created_by.

Copy link
Member

@andrewtavis andrewtavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final commit on my end was mostly keeping the changes from the branch here and organizing things. Thanks so much for this, @anthonyshibitov! Always a pleasure, and again apologies that this took so long. Also thanks for the fixes, @to-sta! 😊

@andrewtavis andrewtavis merged commit 152862b into activist-org:main Apr 8, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants