get rid of is_admin(), instead check for django permissions. a couple things were using is_admin(), so now there's an example of the permission adding and usage, as those were ported
26 lines
634 B
Python
26 lines
634 B
Python
"""Twitter settings models."""
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
import logging
|
|
|
|
from django.db import models
|
|
|
|
|
|
log = logging.getLogger('twitter.models')
|
|
|
|
|
|
class TwitterClient(models.Model):
|
|
|
|
"""Track twitter settings and similar."""
|
|
|
|
since_id = models.PositiveIntegerField()
|
|
output_channel = models.CharField(max_length=200, default='', blank=True)
|
|
oauth_token = models.CharField(max_length=256, default='', blank=True)
|
|
oauth_token_secret = models.CharField(max_length=256, default='', blank=True)
|
|
|
|
class Meta:
|
|
permissions = (
|
|
('send_tweets', "Can send tweets via IRC"),
|
|
)
|