Skip to content

Conversation

@alexandros-lekkas
Copy link
Contributor

This addresses #847. I have added the models needed for poll implementation. @sidkama can you review?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces new models to support live chat poll functionality and updates an existing foreign key for review feedback. Key changes include:

  • A migration updating the foreign key relationship in reviewfeedback.
  • New models for LiveChatPollOption, LiveChatPoll, and LiveChatPollVote in the chat app.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/chigame/knowledge_base/migrations/0004_alter_reviewfeedback_guide_id.py Migration to alter the reviewfeedback guide_id foreign key relationship.
src/chigame/chat/models.py New models to implement live chat polls with options and votes.

Copy link

@sidkama sidkama left a comment

Choose a reason for hiding this comment

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

looks good Alex - just curious, why is the Meta class a subclass of LiveChatPollVote? wouldn't it make sense to just have unique_together be an accessible list within LiveChatPollVote instead of its own class? aside from that clarification, this looks good to go pre implementing the actual poll feature in the live chat itself.

@alexandros-lekkas alexandros-lekkas requested a review from Copilot May 20, 2025 01:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds foundational models for poll functionality within live chats.

  • Removes autogenerated header from an existing migration.
  • Introduces LiveChatPollOption, LiveChatPoll, and LiveChatPollVote models.
  • Establishes relationships: polls belong to live chats, link to options, and enforce unique votes.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/chigame/knowledge_base/migrations/0004_alter_reviewfeedback_guide_id.py Removed the autogenerated Django migration header.
src/chigame/chat/models.py Added LiveChatPollOption, LiveChatPoll, and LiveChatPollVote models with fields and relationships.
Comments suppressed due to low confidence (2)

src/chigame/knowledge_base/migrations/0004_alter_reviewfeedback_guide_id.py:1

  • [nitpick] Removing the autogenerated migration header reduces auditability; consider retaining it to track migration metadata.
# Generated by Django 4.2.20 on 2025-05-15 18:27

src/chigame/chat/models.py:66

  • These new poll models appear without any tests; consider adding unit tests for poll creation, option associations, and vote uniqueness.
class LiveChatPollOption(models.Model):

return f"{self.user} reacted with {self.content} to message {self.message}"


class LiveChatPollOption(models.Model):
Copy link

Copilot AI May 20, 2025

Choose a reason for hiding this comment

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

[nitpick] Implement a str method for LiveChatPollOption (e.g., return self.content) to improve admin and debug readability.

Copilot uses AI. Check for mistakes.
@nathanL534 nathanL534 self-assigned this May 22, 2025
@nathanL534
Copy link
Contributor

Hi @alexandros-lekkas if you don't mind ill hop on and fix the merge conflicts.

@alexandros-lekkas
Copy link
Contributor Author

Hi @alexandros-lekkas if you don't mind ill hop on and fix the merge conflicts.

Thank you so much big dawg - appreciate it

Copy link
Contributor

@abargher abargher left a comment

Choose a reason for hiding this comment

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

More merge conflicts here, please take a look.

@nathanL534
Copy link
Contributor

More merge conflicts here, please take a look.

On it right now! -- it looks like the errors are steming from a previous commit so im going to revert back to a working commit

@nathanL534 nathanL534 force-pushed the live-chat/add-the-models-needed-to-create-polls-for-live-chat branch from 4030fa1 to 6ec794a Compare May 25, 2025 18:07
@nathanL534
Copy link
Contributor

More merge conflicts here, please take a look.

On it right now! -- it looks like the errors are steming from a previous commit so im going to revert back to a working commit

All fixed

Copy link
Contributor

@abargher abargher left a comment

Choose a reason for hiding this comment

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

These commits were already merged, looks like they got swept up in another PR while fixing conflicts.

@alexandros-lekkas
Copy link
Contributor Author

@abargher does that mean we can close this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request x/live-chat

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Add the models needed to create polls for live chat

6 participants