Skip to content

adding meeting topic draft feature#288

Closed
JoeJasinski wants to merge 26 commits intochicagopython:mainfrom
JoeJasinski:feature/topic-draft
Closed

adding meeting topic draft feature#288
JoeJasinski wants to merge 26 commits intochicagopython:mainfrom
JoeJasinski:feature/topic-draft

Conversation

@JoeJasinski
Copy link
Copy Markdown
Contributor

@JoeJasinski JoeJasinski commented May 4, 2020

This is a PR to address the following. More info to come, but creating a placeholder PR.

See the attached issue for information on how this works.
#287

This PR requires one migration to add a new TopicDrafts table.

@JoeJasinski JoeJasinski changed the title [WORK IN PROGRESS] adding meeting topic draft feature adding meeting topic draft feature May 6, 2020
@elmq0022 elmq0022 self-requested a review May 7, 2020 11:06
Comment thread chipy_org/apps/meetings/forms.py Outdated
Comment thread chipy_org/apps/meetings/forms.py Outdated
Comment on lines +72 to +73
return bleach.clean(desc, tags=bleach.sanitizer.ALLOWED_TAGS + ["p", "ins", "del"])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm guessing that this is being handled differently somewhere else in the code. But that's just a guess.

I have the <p> tags disappearing in diff as shown below.

image

@sophm256 sophm256 self-requested a review May 17, 2020 04:03
@sophm256
Copy link
Copy Markdown
Contributor

@JoeJasinski Really nice job on this feature! I left you a comment on Slack that talks a little bit more about this feature. Thanks for all of your hard work and your attention to detail 😄

Copy link
Copy Markdown
Contributor

@elmq0022 elmq0022 left a comment

Choose a reason for hiding this comment

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

Could you get the item around the hash and delete working again?

Comment on lines +306 to +309
def __hash__(self):
if self.pk is None:
raise TypeError("Model instances without primary key value are unhashable")
return hash(self.pk)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is causing an error as it's the only hash function implemented / changed here. I am unable to delete topics through the admin.

image

followed by:

image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, I did confirm this functionality does work on master.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also isn't this the implementation the default? does it need to be overridden specifically?

django model hash

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment on lines +42 to +55
def send_meeting_topic_draft_submitted_email(draft, recipients): # pylint: disable=invalid-name
try:
plaintext = get_template("meetings/emails/meeting_topic_draft_submitted.txt")
htmly = get_template("meetings/emails/meeting_topic_draft_submitted.html")
context = {"topic": draft.topic, "draft": draft, "site": Site.objects.get_current()}
subject = "Chipy: Updates to Meeting Topic Submitted"
from_email = "DoNotReply@chipy.org"
text_content = plaintext.render(context)
html_content = htmly.render(context)
msg = EmailMultiAlternatives(subject, text_content, from_email, recipients)
msg.attach_alternative(html_content, "text/html")
msg.send()
except Exception as e:
logger.exception(e)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we have pretty similar code in three places now, here, the RSVPs, and the contact. I wonder if it's time extract this as a method in a library.

@elmq0022
Copy link
Copy Markdown
Contributor

Also I'm unable to save an edit to a main meeting

image

image

Not sure how this is related.

@JoeJasinski
Copy link
Copy Markdown
Contributor Author

@elmq0022 thanks for the feedback. I originally added that __hash__ method to try to resolve this delete issue, and thought that it had. However, looks like it needs another look. You are right, it is the default implementation; it had looked like the default implementation wasn't being used due to some of the inheritance, so I set it explicitly there. I'll take another look at it this weekend.

I agree that the email logic could be consolidated. I'll create another story where we can consider how we want to make some standard email logic.

@elmq0022
Copy link
Copy Markdown
Contributor

elmq0022 commented May 21, 2020 via email

@elmq0022
Copy link
Copy Markdown
Contributor

elmq0022 commented Jan 1, 2021

@JoeJasinski, I missed your update. Do you need me to take a look at this one?

Base automatically changed from master to main February 15, 2021 00:52
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.

5 participants