Skip to content

Commit

Permalink
Merge pull request #16 from DataIsTheNewBlack/dev
Browse files Browse the repository at this point in the history
Fixed RSS Subscribers Stats Task
  • Loading branch information
DEKHTIARJonathan authored Apr 10, 2017
2 parents 9e92bba + f971977 commit 0890c1d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion feedcrunch/model_files/models_rss_subscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __str__(self):

# First, define the Manager subclass.
class RSSSubsStatManager(models.Manager):
def create(self, user=None, count=0, date=timezone.now() - datetime.timedelta(days=1)):
def create(self, user=None, count=0, date=timezone.localtime(timezone.now() - datetime.timedelta(days=1)).date()):
try:
if user is None:
raise Exception("Feedname is missing")
Expand Down
3 changes: 2 additions & 1 deletion feedcrunch/task_files/task_record_rss_subscribers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def record_user_subscribers_stats(username=None):

#count = usr.rel_rss_subscribers.filter(date__range=(last_lookup_day, today)).values("ipaddress").annotate(n=models.Count("pk")).count()__gte
count = usr.rel_rss_subscribers.filter(date__gte=last_lookup_day).values("ipaddress").annotate(n=models.Count("pk")).count()
RSSSubsStat.objects.create(user=username, count=count)
if RSSSubsStat.objects.create(user=username, count=count) is None:
raise Exception("Error: tasks.record_user_subscribers_stats - An error occured in the object creation process")
else:
raise Exception("Error: tasks.record_user_subscribers_stats - Already exist with datetime: " + str(timezone.now()) + " & date : " + str(timezone.now().date()))

Expand Down
7 changes: 7 additions & 0 deletions scripts/win/launchDeployCheck.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
%~d1
cd "%~p1"
cd "../.."
call venv\Scripts\activate.bat
:: https://docs.djangoproject.com/en/dev/howto/deployment/checklist/
call python manage.py check --deploy
PAUSE;

0 comments on commit 0890c1d

Please sign in to comment.