Skip to content

Commit

Permalink
fix nextcloud scan photos, yapf api/models.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Hooram Nam committed Mar 27, 2019
1 parent fe9789e commit febbba4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,8 +806,10 @@ def _autotitle(self):
if (max(timestamps) - min(timestamps)).days >= 3:
when = '%d days' % ((max(timestamps) - min(timestamps)).days)

weekend = [5,6]
if max(timestamps).weekday() in weekend and min(timestamps).weekday() in weekend and not (max(timestamps).weekday() == min(timestamps).weekday()):
weekend = [5, 6]
if max(timestamps).weekday() in weekend and min(
timestamps).weekday() in weekend and not (
max(timestamps).weekday() == min(timestamps).weekday()):
when = "Weekend"

title = ' '.join([when, pep, loc]).strip()
Expand Down Expand Up @@ -854,7 +856,7 @@ class LongRunningJob(models.Model):
finished = models.BooleanField(default=False, blank=False, null=False)
failed = models.BooleanField(default=False, blank=False, null=False)
job_id = models.CharField(max_length=36, unique=True, db_index=True)
queued_at = models.DateTimeField(default=datetime.now,null=False)
queued_at = models.DateTimeField(default=datetime.now, null=False)
started_at = models.DateTimeField(null=True)
finished_at = models.DateTimeField(null=True)
result = JSONField(
Expand Down
2 changes: 1 addition & 1 deletion nextcloud/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get(self, request, format=None):
# long running jobs

class ScanPhotosView(APIView):
def get(self, requests, format=None):
def get(self, request, format=None):
try:
res = scan_photos.delay(request.user)
logger.info('queued job {}'.format(res.id))
Expand Down

0 comments on commit febbba4

Please sign in to comment.