coalition.endorsements.models
Classes
Represents a stakeholder's endorsement of a policy campaign. |
Module Contents
- class coalition.endorsements.models.Endorsement(*args, **kwargs)[source]
Bases:
django.db.models.Model
Represents a stakeholder’s endorsement of a policy campaign.
The endorsement workflow involves multiple steps: 1. Initial submission (status: pending) 2. Email verification (status: verified) 3. Administrative review (status: approved/rejected) 4. Public display (if approved and consent given)
Each endorsement links a stakeholder to a campaign and includes verification tokens, submission metadata, and moderation tracking. Only one endorsement per stakeholder per campaign is allowed.
- STATUS_CHOICES = [('pending', 'Pending Email Verification'), ('verified', 'Email Verified'), ('approved',...[source]
- save(*args: Any, **kwargs: Any) None [source]
Sanitize statement field before saving to prevent XSS attacks.
- property is_verification_expired: bool[source]
Check if email verification link has expired (24 hours)
- approve(user: django.contrib.auth.models.User | None = None) None [source]
Approve endorsement for public display