Skip to content

Commit

Permalink
Merge branch 'release/v0.5.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
RamezIssac committed Jan 10, 2021
2 parents 02b7a43 + 1291b7d commit e739796
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@

All notable changes to this project will be documented in this file.

## [0.5.5]

- Add datepicker initialization function call (@squio)
- Fixed an issue with default dates not being functional.


## [0.5.4]

- Added missing prefix on integrity hash (@squio)


## [0.5.3]

- Enhanced Field prepare flow
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
master_doc = 'index'

# The full version, including alpha/beta/rc tags
release = '0.5.4'
release = '0.5.5'

# -- General configuration ---------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions slick_reporting/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

default_app_config = 'slick_reporting.apps.ReportAppConfig'

VERSION = (0, 5, 4)
VERSION = (0, 5, 5)

__version__ = '0.5.4'
__version__ = '0.5.5'
14 changes: 12 additions & 2 deletions slick_reporting/app_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,18 @@ def get_end_of_this_year():
return datetime.datetime(d.year + 1, 1, 1, 0, 0)


SLICK_REPORTING_DEFAULT_START_DATE = getattr(settings, '', lazy(get_first_of_this_year, datetime.datetime)())
SLICK_REPORTING_DEFAULT_END_DATE = getattr(settings, '', lazy(get_end_of_this_year, datetime.datetime)())
def get_start_date():
start_date = getattr(settings, 'SLICK_REPORTING_DEFAULT_START_DATE', False)
return start_date or get_first_of_this_year()


def get_end_date():
start_date = getattr(settings, 'SLICK_REPORTING_DEFAULT_END_DATE', False)
return start_date or get_end_of_this_year()


SLICK_REPORTING_DEFAULT_START_DATE = lazy(get_start_date, datetime.datetime)()
SLICK_REPORTING_DEFAULT_END_DATE = lazy(get_end_date, datetime.datetime)()

SLICK_REPORTING_FORM_MEDIA_DEFAULT = {
'css': {
Expand Down
6 changes: 6 additions & 0 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ def test_product_total_sales(self):
data = report.get_report_data()
self.assertEqual(data[0]['__balance__'], 1800)

@override_settings(SLICK_REPORTING_DEFAULT_START_DATE=datetime.datetime(2020, 1, 1), SLICK_REPORTING_DEFAULT_END_DATE = datetime.datetime(2021, 1, 1))
def test_product_total_sales_with_changed_dated(self):
report = report_generators.ProductTotalSales()
data = report.get_report_data()
self.assertEqual(len(data), 0)

def test_client_client_sales_monthly(self):
report = report_generators.ClientSalesMonthlySeries()

Expand Down

0 comments on commit e739796

Please sign in to comment.