from django.apps import AppConfig
from suit.apps import DjangoSuitConfig


class ApiConfig(AppConfig):
    name = 'api'

class SuitConfig(DjangoSuitConfig):


    def ready(self):
        super(SuitConfig, self).ready()

        # DO NOT COPY FOLLOWING LINE
        # It is only to prevent updating last_login in DB for demo app
        self.prevent_user_last_login()

    def prevent_user_last_login(self):
        """
        Disconnect last login signal
        """
        from django.contrib.auth import user_logged_in
        from django.contrib.auth.models import update_last_login
        user_logged_in.disconnect(update_last_login)