Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete Entry from Group List; Delete List if Empty #196

Closed
wants to merge 1 commit into from

Conversation

krkeegan
Copy link
Collaborator

@krkeegan krkeegan commented Mar 2, 2020

A simple bug fix.

The modem delete db function didn't handle group deletion properly.

This fixes that.

The modem delete db function didn't handle group deletion properly.

This fixes that.
@TD22057
Copy link
Owner

TD22057 commented Aug 15, 2020

I'm not sure what to do to trigger this but I'm going to assume you're correct about the bug. I've changed your code from this:

         if entry.is_controller:
            responders = self.groups.setdefault(entry.group, [])
            if entry in responders:
                responders.remove(entry)
            if not responders and entry.group in self.groups:
                del self.groups[entry.group]

to be the following (I don't like adding the empty list if it's not needed)

        if entry.is_controller:
            responders = self.groups.get(entry.group)
            if responders:
                if entry in responders:
                    responders.remove(entry)

            elif entry.group in self.groups:
                del self.groups[entry.group]

@TD22057 TD22057 closed this Aug 15, 2020
@krkeegan krkeegan deleted the Fix_Modem_DB_Del branch December 17, 2020 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants