diff --git a/api/handlers.py b/api/handlers.py index 6c1e82f..a74bd3e 100755 --- a/api/handlers.py +++ b/api/handlers.py @@ -111,7 +111,6 @@ class EveAPIProxyHandler(BaseHandler): obj = get_object_or_404(EVEAccount, pk=params['userid']) params['apikey'] = obj.api_key - print params cached_doc = CachedDocument.objects.api_query(url_path, params, exceptions=False) return HttpResponse(cached_doc.body) diff --git a/eve_api/api_puller/accounts.py b/eve_api/api_puller/accounts.py index ff338e3..7dc265e 100755 --- a/eve_api/api_puller/accounts.py +++ b/eve_api/api_puller/accounts.py @@ -157,7 +157,11 @@ def import_eve_character(api_key, user_id, character_id): else: pchar.gender = 2 - pchar.race = API_RACES[values['race']] + for v in API_RACES_CHOICES: + val, race = v + if race == values['race']: + pchar.race = val + break total = 0 for skill in values['skills']: diff --git a/eve_api/app_defines.py b/eve_api/app_defines.py index 48e5905..a8fd30f 100644 --- a/eve_api/app_defines.py +++ b/eve_api/app_defines.py @@ -43,25 +43,3 @@ API_BLOODLINES_CHOICES = ( (12, 'Ni-Kunni'), (13, 'Caldari'), ) - -API_RACES = { - 'Caldari': 1, - 'Minmatar': 2, - 'Gallente': 3, - 'Amarr': 4, -} - -API_BLOODLINES = { - 'Sebiestor': 1, - 'Vherokior': 2, - 'Brutor': 3, - 'Intaki': 4, - 'Gallente': 5, - 'Jin-Mei': 6, - 'Civire': 7, - 'Deteis': 8, - 'Achura': 9, - 'Amarr': 10, - 'Khanid': 11, - 'Ni-Kunni': 12, -} diff --git a/eve_api/models/api_player.py b/eve_api/models/api_player.py index 8a0b7d1..4a37232 100644 --- a/eve_api/models/api_player.py +++ b/eve_api/models/api_player.py @@ -39,11 +39,6 @@ class EVEAccount(EVEAPIModel): verbose_name="API Status", help_text="End result of the last attempt at updating this object from the API.") - @property - def api_status_description(self): - for choice in API_STATUS_CHOICES: - if choice[0] == self.api_status: - return choice[1] def in_corp(self, corpid): for char in self.characters.all(): @@ -90,18 +85,6 @@ class EVEPlayerCharacter(EVEAPIModel): objects = EVEPlayerCharacterManager() - @property - def gender_description(self): - for choice in API_GENDER_CHOICES: - if choice[0] == self.gender: - return choice[1] - - @property - def race_description(self): - for choice in API_RACES_CHOICES: - if choice[0] == self.race: - return choice[1] - def __unicode__(self): if self.name: return "%s (%d)" % (self.name, self.id) diff --git a/fabfile.py b/fabfile.py index 0cbcbfd..478880c 100644 --- a/fabfile.py +++ b/fabfile.py @@ -5,8 +5,8 @@ env.repo = 'git://dev.dredd.it/dreddit-auth.git' def production(): "Use the production enviroment on Web1" - env.hosts = ['matalok@web1.dredd.it'] - env.path = '/home/matalok' + env.hosts = ['dreddit@syndicate.tensixtyone.com'] + env.path = '/home/dreddit/apps' def test(): "Use the test enviroment on Web2" diff --git a/hr/views.py b/hr/views.py index 698f8cb..ba468d0 100644 --- a/hr/views.py +++ b/hr/views.py @@ -157,7 +157,6 @@ def admin_applications(request): limit = request.get['l'] else: limit = 10 - print query, limit apps = Application.objects.filter(character__name__icontains=query)[:limit] else: view_status = [APPLICATION_STATUS_AWAITINGREVIEW, APPLICATION_STATUS_ACCEPTED, APPLICATION_STATUS_QUERY] diff --git a/reddit/cron.py b/reddit/cron.py index a8c42c2..ec888f1 100644 --- a/reddit/cron.py +++ b/reddit/cron.py @@ -21,7 +21,6 @@ class UpdateAPIs(): def job(self): delta = datetime.timedelta(seconds=self.last_update_delay) - print delta self._logger.debug("Updating accounts older than %s" % (datetime.datetime.now() - delta)) for acc in RedditAccount.objects.filter(last_update__lt=(datetime.datetime.now() - delta)): diff --git a/reddit/forms.py b/reddit/forms.py index f9567f3..7ede80b 100644 --- a/reddit/forms.py +++ b/reddit/forms.py @@ -4,6 +4,8 @@ from django.contrib.auth.models import User from reddit.models import RedditAccount class RedditAccountForm(forms.ModelForm): + """ Basic Reddit account input form """ + user = forms.ModelChoiceField(queryset=User.objects.order_by('username')) username = forms.CharField(label = u'Reddit Username', max_length=64) diff --git a/reddit/models.py b/reddit/models.py index 26af106..90b9134 100644 --- a/reddit/models.py +++ b/reddit/models.py @@ -48,6 +48,8 @@ class RedditAccount(models.Model): self.last_update = datetime.now() def recent_posts(self): + """ Returns the first page of posts visible on the user's profile page """ + try: jsondoc = json.load(urllib.urlopen("http://reddit.com/user/%s.json" % self.username)) except: diff --git a/sso/forms.py b/sso/forms.py index b784b08..b1b597a 100644 --- a/sso/forms.py +++ b/sso/forms.py @@ -36,8 +36,6 @@ def UserServiceAccountForm(user): services = Service.objects.filter(groups__in=user.groups.all(),active=1).exclude(id__in=ServiceAccount.objects.filter(user=user).values('service')).distinct() chars = EVEPlayerCharacter.objects.filter(eveaccount__user=user) - print len(services) - class ServiceAccountForm(forms.Form): """ Service Account Form """ diff --git a/sso/models.py b/sso/models.py index b738ea9..13f2704 100644 --- a/sso/models.py +++ b/sso/models.py @@ -68,9 +68,7 @@ class SSOUser(models.Model): # Generate the list of groups to add/remove delgroups = set(set(self.user.groups.all()) & set(corpgroups)) - set(chargroups) addgroups = set(chargroups) - set(set(self.user.groups.all()) & set(corpgroups)) - - print "Add: ", addgroups, "Del:", delgroups, "Current:", self.user.groups.all() - + for g in delgroups: self.user.groups.remove(g) diff --git a/templates/sso/character.html b/templates/sso/character.html index 305a8f0..2bd4d20 100644 --- a/templates/sso/character.html +++ b/templates/sso/character.html @@ -12,8 +12,8 @@