<s> import datetime <EOL> from corehq . apps . users . models import WebUser <EOL> from custom . ewsghana . reminders import WEB_REMINDER <EOL> from custom . ewsghana . reminders . web_user_reminder import WebUserReminder <EOL> from custom . ewsghana . utils import has_notifications_enabled <EOL> class VisitWebsiteReminder ( WebUserReminder ) : <EOL> def get_users ( self ) : <EOL> return WebUser . by_domain ( self . domain ) <EOL> def recipients_filter ( self , user ) : <EOL> sql_location = user . get_sql_location ( self . domain ) <EOL> if not sql_location or not sql_location . location_type . administrative : <EOL> return False <EOL> date = datetime . datetime . utcnow ( ) - datetime . timedelta ( weeks = <NUM_LIT> ) <EOL> return user . last_login < date and has_notifications_enabled ( self . domain , user ) <EOL> def get_message ( self , recipient ) : <EOL> return WEB_REMINDER % { '<STR_LIT:name>' : recipient . full_name } </s>
