Merge branch 'stable'
This commit is contained in:
commit
391895fbeb
|
@ -36,7 +36,7 @@ repos:
|
||||||
exclude: ^legacy/public(?!/js/airtime)
|
exclude: ^legacy/public(?!/js/airtime)
|
||||||
|
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v3.9.0
|
rev: v3.10.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: [--py38-plus]
|
args: [--py38-plus]
|
||||||
|
|
|
@ -31,7 +31,7 @@ setup(
|
||||||
"types-requests>=2.31.0,<2.32",
|
"types-requests>=2.31.0,<2.32",
|
||||||
],
|
],
|
||||||
"sentry": [
|
"sentry": [
|
||||||
"sentry-sdk>=1.15.0,<1.29",
|
"sentry-sdk>=1.15.0,<1.30",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
|
|
|
@ -41,14 +41,14 @@ setup(
|
||||||
"django-coverage-plugin>=3.0.0,<3.2",
|
"django-coverage-plugin>=3.0.0,<3.2",
|
||||||
"django-stubs>=1.14.0,<4.3",
|
"django-stubs>=1.14.0,<4.3",
|
||||||
"djangorestframework-stubs>=1.8.0,<3.15",
|
"djangorestframework-stubs>=1.8.0,<3.15",
|
||||||
"model_bakery>=1.10.1,<1.13",
|
"model_bakery>=1.10.1,<1.14",
|
||||||
"psycopg[binary]>=3.1.8,<3.2",
|
"psycopg[binary]>=3.1.8,<3.2",
|
||||||
"pylint-django>=2.5.3,<2.6",
|
"pylint-django>=2.5.3,<2.6",
|
||||||
"pytest-django>=4.5.2,<4.6",
|
"pytest-django>=4.5.2,<4.6",
|
||||||
"requests-mock>=1.10.0,<1.12",
|
"requests-mock>=1.10.0,<1.12",
|
||||||
],
|
],
|
||||||
"sentry": [
|
"sentry": [
|
||||||
"sentry-sdk[django]>=1.15.0,<1.29",
|
"sentry-sdk[django]>=1.15.0,<1.30",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
|
@ -40,6 +40,7 @@ function checkPhpDependencies()
|
||||||
function checkDatabaseDependencies()
|
function checkDatabaseDependencies()
|
||||||
{
|
{
|
||||||
global $extensions;
|
global $extensions;
|
||||||
|
|
||||||
// Check the PHP extension list for the Postgres db extensions
|
// Check the PHP extension list for the Postgres db extensions
|
||||||
return in_array('pdo_pgsql', $extensions)
|
return in_array('pdo_pgsql', $extensions)
|
||||||
&& in_array('pgsql', $extensions);
|
&& in_array('pgsql', $extensions);
|
||||||
|
|
|
@ -98,6 +98,7 @@ class CeleryManager
|
||||||
|
|
||||||
throw new CeleryTimeoutException('Celery task ' . $task->getDbName() . ' with ID ' . $task->getDbTaskId() . ' timed out');
|
throw new CeleryTimeoutException('Celery task ' . $task->getDbName() . ' with ID ' . $task->getDbTaskId() . ' timed out');
|
||||||
}
|
}
|
||||||
|
|
||||||
// The message hasn't timed out, but it's still false, which means it hasn't been
|
// The message hasn't timed out, but it's still false, which means it hasn't been
|
||||||
// sent back from Celery yet.
|
// sent back from Celery yet.
|
||||||
throw new CeleryException('Waiting on Celery task ' . $task->getDbName() . ' with ID ' . $task->getDbTaskId());
|
throw new CeleryException('Waiting on Celery task ' . $task->getDbName() . ' with ID ' . $task->getDbTaskId());
|
||||||
|
|
|
@ -52,10 +52,9 @@ class Application_Common_HTTPHelper
|
||||||
class ZendActionHttpException extends Exception
|
class ZendActionHttpException extends Exception
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param int $statusCode
|
* @param int $statusCode
|
||||||
* @param string $message
|
* @param string $message
|
||||||
* @param int $code
|
* @param int $code
|
||||||
* @param Exception $previous
|
|
||||||
*
|
*
|
||||||
* @throws Zend_Controller_Response_Exception
|
* @throws Zend_Controller_Response_Exception
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -116,9 +116,11 @@ class WebstreamController extends Zend_Controller_Action
|
||||||
/*we are updating a playlist. Ensure that if the user is a
|
/*we are updating a playlist. Ensure that if the user is a
|
||||||
host/dj, that he has the correct permission.*/
|
host/dj, that he has the correct permission.*/
|
||||||
$user = Application_Model_User::getCurrentUser();
|
$user = Application_Model_User::getCurrentUser();
|
||||||
|
|
||||||
// only allow when webstream belongs to the DJ
|
// only allow when webstream belongs to the DJ
|
||||||
return $webstream->getDbCreatorId() == $user->getId();
|
return $webstream->getDbCreatorId() == $user->getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*we are creating a new stream. Don't need to check whether the
|
/*we are creating a new stream. Don't need to check whether the
|
||||||
DJ/Host owns the stream*/
|
DJ/Host owns the stream*/
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -125,6 +125,7 @@ SQL;
|
||||||
foreach ($data as $show_id) {
|
foreach ($data as $show_id) {
|
||||||
$all_show_data = array_merge(self::getShowDataPointsWithinRange($p_start, $p_end, $show_id['show_id']), $all_show_data);
|
$all_show_data = array_merge(self::getShowDataPointsWithinRange($p_start, $p_end, $show_id['show_id']), $all_show_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* option to sort by number of listeners currently commented out
|
/* option to sort by number of listeners currently commented out
|
||||||
usort($all_show_data, function($a, $b) {
|
usort($all_show_data, function($a, $b) {
|
||||||
return $a['average_number_of_listeners'] - $b['average_number_of_listeners'];
|
return $a['average_number_of_listeners'] - $b['average_number_of_listeners'];
|
||||||
|
|
|
@ -1209,6 +1209,7 @@ SQL;
|
||||||
$row = intval($date->format('w')) % count($palette);
|
$row = intval($date->format('w')) % count($palette);
|
||||||
$foo = $date->format('H');
|
$foo = $date->format('H');
|
||||||
$col = intval(intval($date->format('H')) / 24.0 * count($palette[0]));
|
$col = intval(intval($date->format('H')) / 24.0 * count($palette[0]));
|
||||||
|
|
||||||
// $color = $palette[$hashValue % sizeof($palette)];
|
// $color = $palette[$hashValue % sizeof($palette)];
|
||||||
return $palette[$row][$col];
|
return $palette[$row][$col];
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,6 +227,7 @@ class Application_Model_User
|
||||||
public function getOwnedFiles()
|
public function getOwnedFiles()
|
||||||
{
|
{
|
||||||
$user = $this->_userInstance;
|
$user = $this->_userInstance;
|
||||||
|
|
||||||
// do we need a find call at the end here?
|
// do we need a find call at the end here?
|
||||||
return $user->getCcFilessRelatedByDbOwnerId();
|
return $user->getCcFilessRelatedByDbOwnerId();
|
||||||
}
|
}
|
||||||
|
|
|
@ -401,6 +401,7 @@ class Application_Service_ShowFormService
|
||||||
Logging::error('Failed to read image: ' . $path);
|
Logging::error('Failed to read image: ' . $path);
|
||||||
$imageData = null;
|
$imageData = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// return the data URI - data:{mime};base64,{data}
|
// return the data URI - data:{mime};base64,{data}
|
||||||
return ($imageData === null || $imageData === '') ?
|
return ($imageData === null || $imageData === '') ?
|
||||||
'' : 'data: ' . mime_content_type($path) . ';base64,' . $imageData;
|
'' : 'data: ' . mime_content_type($path) . ';base64,' . $imageData;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.4",
|
"php": "^7.4",
|
||||||
"friendsofphp/php-cs-fixer": "<3.22.1"
|
"friendsofphp/php-cs-fixer": "<3.23.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ setup(
|
||||||
"types-requests>=2.31.0,<2.32",
|
"types-requests>=2.31.0,<2.32",
|
||||||
],
|
],
|
||||||
"sentry": [
|
"sentry": [
|
||||||
"sentry-sdk>=1.15.0,<1.29",
|
"sentry-sdk>=1.15.0,<1.30",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
bandit>=1.7.4,<1.8
|
bandit>=1.7.4,<1.8
|
||||||
black>=23.1.0,<24.0
|
black>=23.1.0,<24.0
|
||||||
flake8>=6.0.0,<6.1
|
flake8>=6.0.0,<6.2
|
||||||
isort>=5.12.0,<5.13
|
isort>=5.12.0,<5.13
|
||||||
mypy==1.4.1
|
mypy==1.5.0
|
||||||
pylint>=2.16.1,<2.18
|
pylint>=2.16.1,<2.18
|
||||||
pytest-cov>=4.0.0,<4.2
|
pytest-cov>=4.0.0,<4.2
|
||||||
pytest-xdist>=3.1.0,<3.4
|
pytest-xdist>=3.1.0,<3.4
|
||||||
|
|
|
@ -26,7 +26,7 @@ setup(
|
||||||
"types-requests>=2.31.0,<2.32",
|
"types-requests>=2.31.0,<2.32",
|
||||||
],
|
],
|
||||||
"sentry": [
|
"sentry": [
|
||||||
"sentry-sdk>=1.15.0,<1.29",
|
"sentry-sdk>=1.15.0,<1.30",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
|
|
Loading…
Reference in New Issue