Add twitter time line url to property
This commit is contained in:
parent
c6fda4fcee
commit
fed811a227
1 changed files with 4 additions and 1 deletions
|
|
@ -64,11 +64,14 @@ class CollectionRule(TimeStampedModel):
|
|||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
# TODO add twitter url
|
||||
@property
|
||||
def update_url(self):
|
||||
if self.type == RuleTypeChoices.subreddit:
|
||||
return reverse("news:collection:subreddit-update", kwargs={"pk": self.pk})
|
||||
elif self.type == RuleTypeChoices.twitter_timeline:
|
||||
return reverse(
|
||||
"news:collection:twitter-timeline-update", kwargs={"pk": self.pk}
|
||||
)
|
||||
|
||||
return reverse("news:collection:feed-update", kwargs={"pk": self.pk})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue